I have an associative array that is built dynamically from a MySQL table like so:
array(['p.id'] => 3, ['p.fname'] => 'Bill', ['p.lname'] => 'O\'Reilly')
This is a large array and was built this way for reasons that are too long to go into here. The problem, as you can see is that when we attempt to access the value of ['p.lname'] we get "O\"
Anyone have any ideas on how to get around this without modifying the way the array is built? I am currently stripping the slashes and internal apostrophes as a work around, but would prefer to leave the apostrophes in place and just strip the slashes.
This is complicated by the fact that the output goes into a form input like so:
$field = "<input type='text' name='$input_unique_id' style='width:$width;' value='$array_value' />";