tags:

views:

674

answers:

1

I run unsuccessfully

$cookie = "[email protected],777";
$cookie_tripped = trim(",", $_COOKIE['login']);
echo "Cookie: "$cookie_tripped[0];

It gives me

Cookie:

How can you do the following command in PHP?

 awk -F, '{ print $1 }'
+2  A: 
$cookie = "[email protected],777";
$cookie_tripped = split(",", $cookie);
echo "Cookie: " . $cookie_tripped[0];
Sean Bright
split() is for regular expressions. use explode() instead.
Philippe Gerber