Can i separate a php variable?
okay so lets say $word = abcdefg@hijk.lmn
can i make a new v开发者_JAVA百科ariable only everything upto the "@"
and another everything after?
( I.E. $one = abcdefg & $two = hijk.lmn )
thanks alot
use explode
.
$word = 'abcdefg@hijk.lmn';
$my_array = explode('@', $word);
echo $my_array[0]; // prints "abcdefg"
echo $my_array[1]; // prints "hijk.lmn"
http://php.net/manual/en/function.explode.php
list($one, $two) = split("@", $word);
精彩评论