assign
This function assigns a value to a variable which is specified in the 1st function parameter containing a code piece or string containing the assignment destination.
Indirect parameter passing is disabled
2
No. | Type | Description |
---|---|---|
1 code |
variable :string |
destination variable |
2 input |
all types | Value to assign The specified value provided in this parameter will be assigned in the target variable. |
v[] = "b[]";
assign( c[] , 456 );
assign( :v[] , 123 );
assign( :"d[]", 789 );
// Note the required colon. Otherwise v[] is the variable to assign to.
echo("Variable b[] = ", b[] );
echo("Variable c[] = ", c[] );
echo("Variable d[] = ", d[] );
Variable b[] = 123
Variable c[] = 456
Variable d[] = 789
statements [function]
expression [function]