String to array ???

From: Date: Fri, 18 Jan 2002 15:11:17 +0000
Subject: String to array ???
Groups: php.general 
Request: Send a blank email to php-general+get-81091@lists.php.net to get a copy of this message
Hi, I have a for loop in which a variable $privid reads and stores the content from a xmlfile in the form of a string.. the string has 5 different values... I want to call this variable $privid outside the loop like this... for($y_au=0; $y_au<sizeof($priv); $y_au++) { $this->privid = $childNodes[$y]->content ; print $this->privid; // here the variale privid stores and prints all the 5 values as a string.. } function id() { print $this->privid; // here only the last value of in the string is being printed ..WHY??? and how can I resolve this?? return $this->privid; // RETURNS ONLY THE LAST VALUE IN THE STRING.. Why?? } Thanks in adv.:) sands p.S: I tried using an array within the for loop (had posted yest about it..) but makes no diff..

« previous php.general (#81091) next »