Jump to content

Recommended Posts

Nothing to change in php.ini

 

echo $array['var']; should always work, as long as $array['var'] exists.

 

echo  $array[var]; will give you a warning unless you have a constant called var. If you don't, it will assume that you meant 'var' instead, and act accordingly; but it still generates the warning to let you know you've done something wrong.

 

Link to comment
https://forums.phpfreaks.com/topic/144610-arrayvar-vs-arrayvar/#findComment-758826
Share on other sites

As Mark Baker pointed out, it better to fix the errors because disabling NOTICES can effect other problems especially if you have registered globals on. But if you must disable the notice so you can use [var] or ['var'], then...

 


// in your script..

error_reporting ( E_ALL ^ E_NOTICE );


// or php.ini

error_reporting = E_ALL ^ E_NOTICE

Link to comment
https://forums.phpfreaks.com/topic/144610-arrayvar-vs-arrayvar/#findComment-758828
Share on other sites

Must be a homework question - http://www.phpfreaks.com/forums/index.php/topic,238023.0.html

 

The answer is - you don't change anything in your php.ini to fix code that is using the second form (without quotes), you fix your code to use the correct syntax.

Link to comment
https://forums.phpfreaks.com/topic/144610-arrayvar-vs-arrayvar/#findComment-758847
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.