note 1973 modified in function.wddx-deserialize by yannick
| From: | yannick@php.net | Date: | Fri, 25 Jul 2008 16:56:39 +0000 |
| Subject: | note 1973 modified in function.wddx-deserialize by yannick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142707@lists.php.net to get a copy of this message | ||
The packet string you pass to this function doesn't have to be sanitized first; it searches for
a WDDX packet within the string. So the string can contain HTML markup and random text outside of
the packet, and that is all ignored.
This means you can get a packet from another web page like this:
<?php
$fhandle = fopen("http://myserver.com/packet.php",
"r");
if ($fhandle) {
$page = fread($fhandle,10000);
fclose($fhandle);
$value = wddx_deserialize($page);
print "pi is:<br>" . $value["pi"] . "<p>\n";
} else {
print "could not get packet.php<p>";
}
?>
--was--
The packet string you pass to this function doesn't have to be sanitized first; it searches for
a WDDX packet within the string. So the string can contain HTML markup and random text outside of
the packet, and that is all ignored.
This means you can get a packet from another web page like this:
$fhandle = fopen("http://myserver.com/packet.php",
"r");
if ($fhandle) {
$page = fread($fhandle,10000);
fclose($fhandle);
$value = wddx_deserialize($page);
print "pi is:<br>" . $value["pi"] . "<p>\n";
} else {
print "could not get packet.php<p>";
}
http://php.net/manual/en/function.wddx-deserialize.php