note 16301 added to function.xml-set-character-data-handler

From: Date: Wed, 24 Oct 2001 08:24:08 +0000
Subject: note 16301 added to function.xml-set-character-data-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-19366@lists.php.net to get a copy of this message
If you want to strip unwanted whitespace in an HTML-like manner then there are two steps. The first you need to strip consecutive whitespaces from all you input data like this: $data = eregi_replace ( "[[:space:]]+", " ", $data ); Then in your cdata handler make a check to see if it's blank space. An easy way is like this: if ( trim ( $cdata ) ) { work on cdata } That should take care of any whitespace issues you might have. -- http://www.php.net/manual/en/function.xml-set-character-data-handler.php http://master.php.net/manage/user-notes.php?action=edit+16301 http://master.php.net/manage/user-notes.php?action=delete+16301 http://master.php.net/manage/user-notes.php?action=reject+16301

« previous php.notes (#19366) next »