I have a custom module which replaces some asci characters with htlm equivalent for display on the webpages. I am exporting from a FileMaker database and importing via Feeds Module.
In my custom module I added this:
$node->field_book_title['und']['0']['value'] = str_replace("'","'",$node->field_book_title['und']['0']['value']);
and then get an error and cannot see the screen. I want to display an apostrophe in the appropriate places and thought I did it correctly but ...
I also want to replace "<br>" with a line break and now am afraid of trying that ... suggestions please.
thanks,
Pia
At 05:07 PM 5/2/2013, Pia Oliver wrote:
I have a custom module which replaces some asci characters with htlm equivalent for display on the webpages. I am exporting from a FileMaker database and importing via Feeds Module.
In my custom module I added this:
$node->field_book_title['und']['0']['value'] =str_replace("'","'",$node->field_book_title['und']['0']['value']);
and then get an error and cannot see the screen. I want to display an apostrophe in the appropriate places and thought I did it correctly but ...
I also want to replace "<br>" with a line break and now am afraid of trying that ... suggestions please.
thanks,
Pia
Why don't you use something the function html_entity_decode. http://php.net/html_entity_decode
$node->field_book_title['und']['0']['value'] = html_entity_decode($node->field_book_title['und']['0']['value'],ENT_QUOTES);
For your second question, look at the function nl2br(), http://php.net/nl2br
Ken