Re: PHP5 simpleXML bug or am i just being silly :)

From: Date: Thu, 26 Feb 2004 20:58:09 +0000
Subject: Re: PHP5 simpleXML bug or am i just being silly :)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-178961@lists.php.net to get a copy of this message
Dont you need to use " instead of ' as ' is a string literal, while " parses variables etc in that string try this instead: print("<p>$this->user->site[0]::</p>"); Maybe that will help? -- Luke "William Bailey" <wb@pro-net.co.uk> wrote in message news:403E3849.8020200@pro-net.co.uk... Hi All, I am currently working with PHP5 beta and have found something strange with the simplexml objects. It seems to be forgetting its values. Below is an example.. [[the PHP5 code]] <snip> print('<pre>'); print('<p>$this->user::</p>'); print_r($this->user); print('<p>$this->user->site::</p>'); print_r($this->user->site); print('<p>$this->user->site[0]::</p>'); print_r($this->user->site[0]); die('</pre>'); <snip> [[END]] [[the PHP5 Browser Output]] $this->user:: simplexml_element Object ( [login] => wb [password] => 3c1175c6cdf614fb006cee10fdc325e3aa0f1894 [site] => Array ( [0] => www.pro-net.co.uk [1] => www.example.com ) ) $this->user->site:: Array ( [0] => simplexml_element Object ( ) [1] => simplexml_element Object ( ) ) $this->user->site[0]:: simplexml_element Object ( ) [[END]] Shouldn't $this->user->site return the Array displayed in the output for $this->user or even shouldn't the simplexml_element Objects for $this->user->site have a value or something. Basically they shouldn't be blank otherwise how to you get the data?

« previous php.general (#178961) next »