Char list contains 89 symbols [ 1 ] Adding random symbol: A [ 2 ] Adding random symbol: ^ [ 3 ] Adding random symbol: < [ 4 ] Adding random symbol: r [ 5 ] Adding random symbol: - [ 6 ] Adding random symbol: d [ 7 ] Adding random symbol: 6 [ 8 ] Adding random symbol: { Result: A^ Code (markup): Char list contains 89 symbols [ 1 ] Adding random symbol: A [ 2 ] Adding random symbol: U [ 3 ] Adding random symbol: m [ 4 ] Adding random symbol: ^ [ 5 ] Adding random symbol: G [ 6 ] Adding random symbol: G [ 7 ] Adding random symbol: < [ 8 ] Adding random symbol: < Result: AUm^GG<< Code (markup): As you see, whenever there's <, everything falls apart. The main thing I don't get it is why it does so and why doesn't it fail when there are 2 symbols in a row. ** It's the only symbol I have problems with. ** Don't ask for code - it's a simple function - an array, explode and for loop .. Any ideas ?
u r adding these to something and < is getting in as a comparing < and not just bracket... Try using HTML ascii hex
AND... No code != workaround If you need workaround, you need to display code... and try to use words like 'please' Oh yea.... am being the big daddy here =)
You're not mentioning how you're using the values in the array... Outputting to html, script, etc.? Try using ( < or %3C or < ) You might also look into the functions: htmlspecialchars(), htmlentities(), and urlencode().
Thank you - transforming it to a an ASCII representation did the job For the given case the problem have been solved but I'm still confused - why does it treat it as an operator when placed as a string ( double-quotes ) ? Really ? See above ..
Lol ok.... 'why does it treat it as an operator when placed as a string ( double-quotes ) ?' To find an answer for yourself and to learn it, run this: <?php $variable = "Yahoo"; echo 'this is with single quotes: $variable'; print_r '<br />'; echo "this is with double quotes: $variable"; ?> PHP: And u will see the difference Try using single quotes and let us all know here
$sum = "1 + 2"; PHP: Will the output be 3 ? No. Also, the thing is that I don't use any quotes at all - I just concatenate something ( variable ) to an already existing variable. ** I still don't get why does it fall apart instead of just skipping the given character ..