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

  • SEARCH
  • Home
  • 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 8564921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:18:19+00:00 2026-06-11T17:18:19+00:00

I hit a strange problem with PHP and its require_once language construct. I require

  • 0

I hit a strange problem with PHP and its require_once language construct.

I require file called EN-en.php. It contains the English language for my website, I wrote it like this:

....
$lang['header']['loginbox']['menu'][1] = "contacts" ;
$lang['header']['loginbox']['menu'][2] = "settings" ;
....

Then I user this code to include my file in the whole site

require_once $langFile ;

Very easy I think, $langFile is = "/var/www/webstite/langs/EN-en.php". But here’s come the strange part.

When I use

echo $lang['header']['loginbox']['menu'][1]; 

It prints something like “Gontacts” … I can’t understand why, and it’s not the only case.. Please someone can help me with this issue?.

  • 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-11T17:18:20+00:00Added an answer on June 11, 2026 at 5:18 pm

    You are probably overwriting your own values in the array.

    See this simple example:

    $test = "some text";
    $test['menu'] = 'extra';
    var_dump($test);
    // produces: string(9) "eome text"
    // the first character - $test[0] - gets overwritten
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hit a strange problem today and even as a PHP engineer i'm stumped
I am coding a file sharing application for my office. One strange problem I
Having a really strange problem. Scenario: PHP5.2.9, IIS7, PHP running as FastCGI. I have
I've recently hit a strange problem with my iOS app and have no idea
I'm currently writing a Rails app, and hit a somewhat strange quirk. I have
I hit Linux's 32,000 subdirectory limit. It caused problems with my PHP scripts and
today i hit a really annoing problem with wpf. i just want to align
I was recently hit with a puzzling problem with no explanation that I somehow
I've hit this problem recently, and I've been stuck at it for a few
I have come across a strange problem with Zend_Framework, I can not load forms

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.