I have problem echo’ing an array.
$test = 'one two three four';
$arr = explode(' ', $test);
echo '<br />+'.$arr[0].' +(>'.$arr[1].' <'.$arr[2].'';
It stops echoing at $arr[1], and I need this for a special query in mysql.
What I need to achieve is:
('+one +(>two <three)
Also, I would like to know how can I use “<” character from $arr[2] to ~. So in short, what I’m tring to achieve is:
('+one +(>two <three <four ... <infinite)
It doesn’t stop echoing, the browser just mistakes the
<character for the start of a tag and acts accordingly.If you want to display this output, you should call
htmlspecialcharson it first. Otherwise (e.g. for the query) no special treatment is needed.For your last question: you ‘d do something like