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 6641569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:49:34+00:00 2026-05-25T23:49:34+00:00

I have the following line in a php file: $labels[‘study’] = ‘Study’; Then, I

  • 0

I have the following line in a php file:

$labels['study'] = 'Study';

Then, I include that file in my index page to print the value. It gets the value but instead of printing “Study”, it prints ” Study” (with a blank at the beginnig).
I’ve tried aplying trim() to the returned value and in other places but it has no effect.

The way I’m returning the value is:

<?=get_label('study')?>

There is always a blank (or other blank characters) at the beginning.

I’m wondering why this happens. Any idea?

The get_label function is this:

function get_label($texto){
    require("lang/".$_SESSION['lang'].".php");
    $traduccion = trim($labels[$texto]);
    if($traduccion == '')
        return '['.$texto.']';
    else
        return $traduccion;

And the code above and below where I call the function:

<div>
    <h2><?=get_label('Estudio')?></h2>
    <?=get_text('estudio');?></div> 
</div>

I’ve tried with all of it in the same line (from to ) and it neither works.

  • 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-05-25T23:49:35+00:00Added an answer on May 25, 2026 at 11:49 pm

    You probably have a space in the HTML code before the <?= tag, not in the PHP variable.

    If that’s not a space, it could be a new line as well (in the HTML).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a line of PHP code that does the following: $xml = <xml><request>...[snipped
Using the Create ZIP File PHP class I have the following line of code
I have the following line in my trace file: 0.5927 12212144 2780040.00 -> require_once(E:\web\lib\nusoap\nusoap.php)
I have the following line in my IsapiRewrite.ini file: RewriteRule ^/test-url.asp$ http://www.google.co.uk/ [R=301,L] But
I have the following line of text that I need to display <ul><li>Complementary to
Let's suppose I have the following line in a CSV file (I removed the
I have uncomment the following from the php.ini file ;extension=php_bz2.dll extension=php_curl.dll ;extension=php_dba.dll Also ,I
I have written the following while loop in a php file. The file does
I have the following code which works perfectly fine in my php file and
I have following in my config.php file for one of my web app. //db

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.