Jump to content

PHP Split Problems


yanjchan

Recommended Posts

Ok, I have my string here:

cb9f35facc807b87b3024726e6ffe4ff0382b6e54f84f082c4292fb8251378c3:edba6720b115c4d20fb78b4371d84d3783b1094fac000fc886d865bc1eb9572a@76.103.101.157

That is separated by : and @.

 

I get the string from the cookie using the PHP $_COOKIE['blah'], which works fine.

Then, when I try to split it using:

 

$raw = $_COOKIE['blah'];

$blah = split('[:@]', $raw);

echo "$blah[0]<br />";

echo "$blah[1]<br />";

echo "$blah[2]<br />";

 

Only $blah[0] returns a variable, which is the entire string.

I'm sorry if I'm making a stupid mistake, as I think I've mentioned before, I'm pretty new to PHP.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/150621-php-split-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.