ExpertRefresh

Variables / Type casting  

Related Pages

Definition
Variable
Check
Type casting
Array to object
New object


0.0% 100%
 
 
0 pages 298 questions
1) How do you change $a = 10 to boolean type?





2) Which is incorect?







Type casting in PHP works much as it does in C: the name of the desired type is written in parentheses before the variable which is to be cast. <?php $arr1 = array(1, 2, 3); $arr2 = (string) $arr1; var_dump($arr1); // array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } var_dump($arr2); // string(5) "Array"


References