Return a PHP variable reference to the BEE Variable identified by varname. If the element part is omitted, the array form of the BEE variable will be returned.
Please note the followings:
n Remember to use "=&" to receive the reference. e.g. $a =& BEE_var("apple");
n Be aware that an array is returned if the element part is omitted. For example:
<script language="bee">
var myVar = "abc";
</script>
<?php
$arr =& BEE_var("myVar"); // an array in which $arr[""] is "abc"
$elm =& BEE_var("myVar:"); // a scaler "abc"
?>
n Specifying a non-existing element will create that element in the variable array with null. (This is the same in BEE Script when referring an element with the (var) cast, like "(var)myVar:newElement".)
<script language="bee">
var myVar:x = "abc"; // a single-element array
</script>
<?php
$elm =& BEE_var("myVar:y");
// Now the BEE Variable myVar got a new element y (null value)
// and becomes a two-element array.
$elm = "def"; // myVar now x=>"abc",y=>"def"
?>
n System Class BEE Variables have no corresponding PHP variable reference and therefore cannot be accessed via BEE_var(). You can only use BEE_get () and BEE_set() to access them. If you retrieve a System Class BEE Variables by BEE_var(), the returned reference has no effect on the BEE Variables at all. In fact, such PHP Variables is not in the BEE Scope.
n The "file" part in varname will be ignored if specified.
|