MemoryRefresh!

Type casting



Questions Answers 0%

Pages   0 from 51
Questions   0 from 84

Reset



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"
http://www.php.net
Questions

Related pages

Definition !
Variable !
Check !
Type casting !
Array to object !
New object !


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





2) Which is incorect?





Last Review: n/a   Passed: n/a   Reviews: n/a   Next Review: n/a  


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"
http://www.php.net



More from Php

Basics
Variables
Operators
Function
Array
String
Streams
Uncategorized


More from Programming

Php
jQuery




Powered by minte9.com