Page 1 of 1

Seperating A Variable Into Multiple Variables

Posted: Sun Aug 22, 2004 9:54 pm
by Twirp
How would i make a variable become multiple variables?
like say:
i input twirp@twirp.net
and want it to say:
hello twirp of twirp.net

My book said there's away but it didn't say how...

Posted: Sun Aug 22, 2004 10:25 pm
by John Cartwright

Code: Select all

<?php

$email = "twirp@twirp.net";

$email = explode("@",$email);

echo "Hello $email[0] of $email[1]";

?>
Explode will "explode" the string into different variables.