How can I escape the double quotes in "guru" in Zend form?

630 Views Asked by At

When I tried to populate data in Zend form "guru", it was returning \"guru\". How can I escape or remove the "" from the text field and populating form data without "" as guru?

2

There are 2 best solutions below

2
On BEST ANSWER

Make sure you have Magic Quotes disabled in your php.ini file. They are marked deprecated in PHP 5.3 and are marked for removal in PHP 6 (possibly 5.4).

Use get_magic_quotes_gpc() to find out if it is enabled, and see magic_quotes_gpc option to find out how to disable.

// Are Magic Quotes enabled?
var_dump(get_magic_quotes_gpc());

If this returns true, open your php.ini file and make sure this line = Off

magic_quotes_gpc = Off
0
On

Use $str = str_replace(chr(132), '"', $str);.