Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8807021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:16:19+00:00 2026-06-14T02:16:19+00:00

I have a piece of code which I suspect could be written in a

  • 0

I have a piece of code which I suspect could be written in a more efficient way but I’m still a little rusty on some PHP queries.

Is there a better way to write the following query:

<?php 
if(qtrans_getLanguage()=='en'): echo 'Latest News'; endif;
if(qtrans_getLanguage()=='it'): echo 'Ultime notizie'; endif; 
if(qtrans_getLanguage()=='de'): echo 'Aktuelle Nachrichten'; endif; 
if(qtrans_getLanguage()=='zh'): echo '最新消息'; endif;
if(qtrans_getLanguage()=='es'): echo 'Últimas noticias'; endif;
if(qtrans_getLanguage()=='fr'): echo 'Dernières nouvelles'; endif; 
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:16:20+00:00Added an answer on June 14, 2026 at 2:16 am

    Use a lookup table:

    $table = array(
       'en' => 'Latest News',
       'it' => 'Ultime notizie',
       ....
    );
    
    echo $table[qtrans_getLanguage()];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a piece of code which combines an in-memory list with some data
I have a piece of code which works in a way that is unexpected
I have this piece of code which is running perfectly on localhost but throws
I have piece of code which generates some Random number and prints out on
I have this piece of code which is calling some functions in a web
I have following piece of code which posts some data into database: $post =
I have a small piece of code which does something funny, but I can't
I have this piece of code which I am using to update some values
I have this piece of code which check the last customer_id from the db.
I have this piece of code which I'm hoping will be able to tell

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.