note 49970 deleted from ref.simplexml by didou

From: Date: Tue, 16 Jan 2007 00:47:11 +0000
Subject: note 49970 deleted from ref.simplexml by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-121765@lists.php.net to get a copy of this message
Note Submitter: webmarks ---- I'm new to PHP and XML, but I think others might pull their hair out over this too. I forgot about XML and whitespace when I was populating an array with node values, and was getting what appeared to be duplicate values despite using array_unique(). Use trim() when populating an array or assigning a variable. <?php $xml_array = array(); foreach ($resource->xpath($node_match) as $option){ $xml_array[$i] = trim($option); $i++; } $xml_unique_array = array_unique($xml_array); ?>

« previous php.notes (#121765) next »