hdf_set_value — Set the value of a named node.
bool hdf_set_value( | hdf, | |
name, | ||
value) ; |
resource hdf
;string name
;mixed value
;
Sets the value
of node name
in HDF resource hdf
. Returns true on success, false on failure. value
can be any PHP variable; objects are converted to their string representation.
Example 8. hdf_set_value
using primitive datatypes
<?php $hdf = hdf_init(); hdf_set_value($hdf, 'data.null', null); hdf_set_value($hdf, 'data.bool.true', true); hdf_set_value($hdf, 'data.bool.false', false); hdf_set_value($hdf, 'data.integer.positive', +100); hdf_set_value($hdf, 'data.integer.negative', -72); hdf_set_value($hdf, 'data.float.positive', 0.5321); hdf_set_value($hdf, 'data.float.negative', -79.94134); hdf_set_value($hdf, 'data.array', array(1, 2, 3)); // does NOT add an array; use hdf_set_node() instead hdf_set_value($hdf, 'data.string', 'Getting the picture?'); print hdf_write_string($hdf); ?>