note 58863 modified in function.htmlentities by danbrown

From: Date: Sun, 17 May 2009 17:01:16 +0000
Subject: note 58863 modified in function.htmlentities by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-154925@lists.php.net to get a copy of this message
A version of the xml entities function below. This one replaces the "prime" character (′) with which I had difficulties. <?php // XML Entity Mandatory Escape Characters function xmlentities($string) { return str_replace ( array ( '&', '"', "'", '<', '>', '�' ), array ( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;', '&apos;' ), $string ); } ?> --was-- A version of the xml entities function below. This one replaces the "prime" character (’) with which I had difficulties. // XML Entity Mandatory Escape Characters function xmlentities($string) { return str_replace ( array ( '&', '"', "'", '<', '>', '’' ), array ( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;', '&apos;' ), $string ); } http://php.net/manual/en/function.htmlentities.php

« previous php.notes (#154925) next »