assign value to variable in php code example
Example 1: assign value php
reset($val['MemberSaveRoom'])['is_favour_room'] = true;
$val['MemberSaveRoom'][0]['is_favour_room'] = true;
MemberSaveRoom = array(
[0] = array(
'is_favour_room' => true,
));
Example 2: php variables
<?php
$output = ' Hello there Bob!!';
$num1 = 4;
$num2 =10;
$sum = $num1 + $num2;
$string1 = ' Hello';
$string2 = 'Bobby!!';
$greeting = $string1 .' '. $string2;
$greeting2 = "$string1 $string2";
$string3 = ' They\'re Here';
define('GREETING', ' Hello Everyone!!');
echo $sum;
echo $output;
echo $greeting;
echo $greeting2;
echo $string3;
echo GREETING;
?>
Example 3: how to make a variable in php
$varName = "Hello, World";