| | |
|
|
|
zput
This function allows PHP scripts to put values into the Global Context based on a key. The values can then be accessed using the key. The keys are logically divided by the zones which corresponds to the fist path segment of the key. The lifetime of the key and the value is determined by the zone that the key is associated with. The following are valid keys /request/headers/out/Content-Type with zone /request /config/name with zone /config. NOTE: The function put() has been deprecated, please use zput() instead.
Description
zput (string key, mixed value, boolean binary)
Parameters:
string key - the Global Context key
mixed value - the value associated with the key
boolean binary - if true, the value is put in the global context without any encoding (as a byte array), defaults to false
Return:
Aliases
put
PHP.INI settings
extension = zero.php.ZeroExtension
Examples
<?php
// Put an array into the Global Context and retreive it
$arr = array('a' => 'b', 'c' => 'd');
zput('/request/somename', $arr);
echo "putgetarray:";
$newarr = zget('/request/somename');
foreach ($newarr as $key => $value) {
echo '{'.$key.':'.$value.'}';
}
if (isbinary($gifbytes)) {
zput('/request/gif', $gifbytes, true);
}
?>
|
|
r4 - 28 Jan 2008 - 13:56:49 - zerodocgen
|
|
|
| | |