WDDX_SERIALIZE_VARS(3) 1 WDDX_SERIALIZE_VARS(3)wddx_serialize_vars - Serialize variables into a WDDX packetSYNOPSIS
string wddx_serialize_vars (mixed $var_name, [mixed $...])
DESCRIPTION
Creates a WDDX packet with a structure that contains the serialized representation of the passed variables.
PARAMETERS
This function takes a variable number of parameters.
o $var_name
- Can be either a string naming a variable or an array containing strings naming the variables or another array, etc.
o $...
-
RETURN VALUES
Returns the WDDX packet, or FALSE on error.
EXAMPLES
Example #1
wddx_serialize_vars(3) example
<?php
$a = 1;
$b = 5.5;
$c = array("blue", "orange", "violet");
$d = "colors";
$clvars = array("c", "d");
echo wddx_serialize_vars("a", "b", $clvars);
?>
The above example will output:
<wddxPacket version='1.0'><header/><data><struct><var name='a'><number>1</number></var>
<var name='b'><number>5.5</number></var><var name='c'><array length='3'>
<string>blue</string><string>orange</string><string>violet</string></array></var>
<var name='d'><string>colors</string></var></struct></data></wddxPacket>
PHP Documentation Group WDDX_SERIALIZE_VARS(3)
Check Out this Related Man Page
IS_SCALAR(3) 1 IS_SCALAR(3)is_scalar - Finds whether a variable is a scalarSYNOPSIS
bool is_scalar (mixed $var)
DESCRIPTION
Finds whether the given variable is a scalar.
Scalar variables are those containing an integer, float, string or boolean. Types array, object and resource are not scalar.
Note
is_scalar(3) does not consider resource type values to be scalar as resources are abstract datatypes which are currently based on
integers. This implementation detail should not be relied upon, as it may change.
Note
is_scalar(3) does not consider NULL to be scalar.
PARAMETERS
o $var
- The variable being evaluated.
RETURN VALUES
Returns TRUE if $var is a scalar, FALSE otherwise.
EXAMPLES
Example #1
is_scalar(3) example
<?php
function show_var($var)
{
if (is_scalar($var)) {
echo $var;
} else {
var_dump($var);
}
}
$pi = 3.1416;
$proteins = array("hemoglobin", "cytochrome c oxidase", "ferredoxin");
show_var($pi);
show_var($proteins)
?>
The above example will output:
3.1416
array(3) {
[0]=>
string(10) "hemoglobin"
[1]=>
string(20) "cytochrome c oxidase"
[2]=>
string(10) "ferredoxin"
}
SEE ALSO is_float(3), is_int(3), is_numeric(3), is_real(3), is_string(3), is_bool(3), is_object(3), is_array(3).
PHP Documentation Group IS_SCALAR(3)
Is it possible to pass a variable name, as a parameter to a function, so it can be created within this function ?
Something like this:
func_uppercase abcdefgh var_name
where the 1st parameter is the string I want to convert and the 2nd is the desired variable name...
$2=`echo "$1" |... (2 Replies)
I have a variable, var="some1|some2|some3"
I want to know how many "|" are in $var.
When I say echo $var | grep -c '|'
I am getting only 1 :confused: :confused: :confused: ? (4 Replies)
I have problem like this :
while loop
1 var=some expression
2 if then
3 Do something
4 oldVar=$var
5 fi
6 done
Then, I am facing error at line number 2, mentioning invalid argument. Can anyone please help me for, How to retain value in oldVar? (4 Replies)
hi ,
i want to store variable but i get always error when i excute this command ligne :
var = awk '{print $1}' file1
echo $var
how can i store the var?
thanks (7 Replies)
Hi Guys,
File is containing data
Col1 Col2
ListPrice List Price
Price Average Selling Price - Actual
ProjPrice Average Selling Price
ProjPrice Launch Price
ProjCost Cost
Now i need to print col2 on the basis of col1
i.e if i Pass Price it should display only "Average... (7 Replies)
Hi,
Well as the title says, I have an array of strings (delimited by null). The length of the array is variable and length of each string is variable as well. What I need is one huge string with the original strings in the array separated by spaces.
For example is an array is such that array... (12 Replies)
Hi
I want to know what is the difference between $var and ${var}. :D
I saw in few of the scripts examples.Somewhere people use $var and somewhere ${var}.
Is there any difference between two ? :confused:
Thanks (4 Replies)
Hi All,
I have Solaris-10 machine. Yesterday I patched it with Solaris-10 patch Cluster. Since then glance software is filling up /var/core continuously. In every few minutes, it will fill /var to 100%.
Glance runs through /etc/init.d/mwa and I already stopped it, still core files are... (15 Replies)
Hi All,
I'm a newbie here, i'm having proble concatinating my 2 variables. i tried na \n but it doesn't work.
ex.
var 1="YES,AGREE"
var 2="NO,DISAGREE"
expected output is:
YES,AGREE
NO,DISAGREE
i tried this
var 3 ="${var 1} \n ${var 2}"
it outputs me YES,AGREE\nNO,DISAGREE... (2 Replies)
Hi there,
I'm working on a Suse 8 based system and picked up that the crontab was missing. after some investigation i realized that the hole /var directory is missing. :mad:
I would like to now if its common for this directory to go missing?
Can I copy another Suse 8 /var directory to this... (10 Replies)
hi
i have a string as
var="hello1,hello2,hello3"
now i want to display as
1. hello1
2. hello2
3. hello3
where var is not fixed variable which will increase or decrease the words.
any help with shell scripting
Please use CODE tags (as required by forum rules) when displaying sample... (3 Replies)
Hi,
Wish to remove "DR-" from the string variable (var).
var="DR-SERVER1"
var=`echo $var | sed -e 's/DR-//g'`
echo "$var"
Expected Output:
However, I get the below error:
Can you please suggest. (4 Replies)