echo empty string

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

echo empty string

Post by Ree »

Code: Select all

$_SESSION['msg'] = '';
echo $_SESSION['msg'];
On my local machine, it doesn't output anything, on my host it outputs 'Array'. What is causing this?
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

if that's all of the code, it makes no sense for it to output anything other than an empty string...
is there any more code to go with it?

try doing print_r($_SESSION); and post the result
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Make sure the session is started, and try print_r'ing the $_SESSION variable itself.
Post Reply