I have the following comma delimited string which I am trying to use the split function on
Address,Contact Info,<serial number>,"GPA",12345678890123456
for some reason.... <serial number> is being replaced with a blank space....
can someone please explain why this is happening and give me a possible solution
using an escape functionality within the split function
Moderator: General Moderators
Code: Select all
<pre>
<?php
$string = 'Address,Contact Info,<serial number>,"GPA",12345678890123456';
$foo = split(',',$string);
print_r($foo);
?>If you run this on a clean page, and then viw the source, you'll see the <serial number> as it is.
The browser just tries to use it as a html-tag...
Either remove the <>'s or convert them into ascii/htmlentities etc.