note 93478 modified in function.simplexml-load-file by danbrown

From: Date: Fri, 11 Sep 2009 19:04:37 +0000
Subject: note 93478 modified in function.simplexml-load-file by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-160473@lists.php.net to get a copy of this message
If you need to parse the data from SimpleXML into a session variable remember to define the data as a string first. If you don't you will get warnings of "Node no longer exists" pointing to your session_start() function. This will work: <?php $new_version = simplexml_load_file('http://example.com/version.xml'); $_SESSION['current_version'] = (string)$new_version->version; ?> --was-- If you need to parse the data from SimpleXML into a session variable remember to define the data as a string first. If you don't you will get warnings of "Node no longer exists" pointing to your session_start() function. This will work: <?php $new_version = simplexml_load_file('http://mywebsite/version.xml'); $_SESSION['current_version'] = (string)$new_version->version; ?> http://php.net/manual/en/function.simplexml-load-file.php

« previous php.notes (#160473) next »