Joshua4550 Posted May 23, 2010 Share Posted May 23, 2010 $errors = array(); $errors[0] = "Oh, hello."; echo 'Error 0: ' . $errors[0]; Output is simply nothing, yet if I do empty($errors) it returns false. Why? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/202680-array-value/ Share on other sites More sharing options...
marcus Posted May 23, 2010 Share Posted May 23, 2010 I'm getting an output. Is there anything else running on the script? Quote Link to comment https://forums.phpfreaks.com/topic/202680-array-value/#findComment-1062347 Share on other sites More sharing options...
PFMaBiSmAd Posted May 23, 2010 Share Posted May 23, 2010 You would need to post your actual code the exhibits the problem. The three lines you did post, work are expected. Quote Link to comment https://forums.phpfreaks.com/topic/202680-array-value/#findComment-1062348 Share on other sites More sharing options...
Joshua4550 Posted May 23, 2010 Author Share Posted May 23, 2010 Oh. I'm guessing it's the method then. I'm using a function from an external file to return a value which includes that variable, but I make the variable as shown on first post before I call the function. Best way to accomplish this is to pass the $errors through to the function? Quote Link to comment https://forums.phpfreaks.com/topic/202680-array-value/#findComment-1062350 Share on other sites More sharing options...
kenrbnsn Posted May 23, 2010 Share Posted May 23, 2010 Please post your code. Ken Quote Link to comment https://forums.phpfreaks.com/topic/202680-array-value/#findComment-1062365 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.