[support] help with php please
Ken Robinson
kenrbnsn at rbnsn.com
Fri May 3 01:28:58 UTC 2013
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
More information about the support
mailing list