note 80567 added to function.htmlentities

From: Date: Tue, 22 Jan 2008 21:29:54 +0000
Subject: note 80567 added to function.htmlentities
Groups: php.notes 
Request: Send a blank email to php-notes+get-135320@lists.php.net to get a copy of this message
As "realcj at g mail dt com" wrote in a comment for flashentities, here's an "extension" for reading wordpress cookies and using the addresses and e-mails in them: <?php function wp_entities($string, $encode = 0){ $a = (int) $encode; $original = array("&","'",":","/","@"); $entities = array("%26","%27","%3A","%2F","%40"); if($a == 1) return str_replace($original, $entities, $string); else return str_replace($entities, $original, $string); } ?> Just set the second argument to 1 (int) to make the function act the opposite way. :) Hope it will be useful! ---- Server IP: 80.241.173.254 Probable Submitter: 82.84.119.71 ---- Manual Page -- http://www.php.net/manual/en/function.htmlentities.php Edit -- https://master.php.net/note/edit/80567 Del: integrated -- https://master.php.net/note/delete/80567/integrated Del: useless -- https://master.php.net/note/delete/80567/useless Del: bad code -- https://master.php.net/note/delete/80567/bad+code Del: spam -- https://master.php.net/note/delete/80567/spam Del: non-english -- https://master.php.net/note/delete/80567/non-english Del: in docs -- https://master.php.net/note/delete/80567/in+docs Del: other reasons-- https://master.php.net/note/delete/80567 Reject -- https://master.php.net/note/reject/80567 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135320) next »