help with php please
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 -- Randall House (member Antiquarian Booksellers' Association of America - http://www.ABAA.org , ILAB, IOBA) 835 Laguna Street Santa Barbara, California 93101 (805) 963-1909 fax (805) 963-1650 <http://www.RandallHouseRareBooks.com> Know who your Internet bookseller is! Look for the ABAA membership logo, the Antiquarian Booksellers' Association of America - now more than 50 years of professional organization requiring its members to have a proven track record of knowledge and experience, and to abide by a written code of ethics.
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
participants (2)
-
Ken Robinson -
Pia Oliver