explode() problem

i have a string element that contains this:

<a href="http://www.xxx.com">click here</a>;A "test";;

when i use
[php]$tokens = explode( “;” , $text);[/php]
i get this

echo $tokens[0]; // < echo $tokens[1]; // a href=" echo $tokens[2]; // http://www.xxx.com" echo $tokens[3]; // > echo $tokens[4]; // click here< echo $tokens[5]; // /a>

instead of what i want

echo $tokens[1]; // <a href="http://www.xxx.com">click here</a> echo $tokens[2]; // A "test"" echo $tokens[3]; // echo $tokens[4]; //

anyone knows wth wrong with it?

Works for me.

[php]
$str = ‘click here;A “test”;;’;
$tokens = explode( “;” , $str);
print_r($tokens);
[/php]

Array
(
    [0] => <a href="http://www.xxx.com">click here</a>
    [1] => A "test"
    [2] => 
    [3] => 
)
Sponsor our Newsletter | Privacy Policy | Terms of Service