Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

wddx_serialize_vars(3) [php man page]

WDDX_SERIALIZE_VARS(3)							 1						    WDDX_SERIALIZE_VARS(3)

wddx_serialize_vars - Serialize variables into a WDDX packet

SYNOPSIS
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 scalar

SYNOPSIS
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)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing a variable name to be created within a function

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)
Discussion started by: 435 Gavea
2 Replies

2. UNIX for Dummies Questions & Answers

How to count number of occurrences of a "|" from a variable?

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)
Discussion started by: jingi1234
4 Replies

3. Shell Programming and Scripting

Retaining value in var for flag.

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)
Discussion started by: videsh77
4 Replies

4. Shell Programming and Scripting

affect variable

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)
Discussion started by: kamel.seg
7 Replies

5. UNIX for Dummies Questions & Answers

Find exact string

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)
Discussion started by: Swapna173
7 Replies

6. Shell Programming and Scripting

how can i compare te length of the string

how can i campare te length of the string $var = unix if ( $var -eq 4 ) then.. is it right (6 Replies)
Discussion started by: mail2sant
6 Replies

7. Programming

Concatenating array of strings into one string separated by spaces

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)
Discussion started by: newhere
12 Replies

8. UNIX for Dummies Questions & Answers

Variable inside a variable

Hi, here is the problem description... X=1 var${x}=abc echo ${var${x}} It is not working...:mad: Is there any solution.. Thanks, Swat (2 Replies)
Discussion started by: swat
2 Replies

9. UNIX for Dummies Questions & Answers

Difference between $var and ${var}

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)
Discussion started by: dashing201
4 Replies

10. Emergency UNIX and Linux Support

[Solved] /var is filling continuously

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)
Discussion started by: solaris_1977
15 Replies

11. Shell Programming and Scripting

concat 2 variables with newline

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)
Discussion started by: nikki1200
2 Replies

12. SuSE

Suse 8 /var Directory

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)
Discussion started by: malanve
10 Replies

13. Shell Programming and Scripting

Grep Data Base on Header

HI Guys, File A.txt UID,HD1,HD2,HD3,HD4 1,2,33,44,55 2,10,14,15,16 File B.txt UID HD1 HD4 A.txt B.txt >>>Output.txt UID,HD1,HD4 1,2,55 2,10,16 (11 Replies)
Discussion started by: pareshkp
11 Replies

14. Shell Programming and Scripting

String manpulation

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)
Discussion started by: raghur77
3 Replies

15. Shell Programming and Scripting

Replace substring from a string variable

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)
Discussion started by: mohtashims
4 Replies