This is a discussion on PHP Variable type juggling in PHP within the PHP Programming forums, part of the Web Development category; Hi all... PHP Variable type juggling in PHP Thanks......
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi all.... PHP doesn't require variables to declared using primitive types. Therefore, juggling between two types doesn't require use of any special function. We can simply do things like... <?php //string var $var = "0"; //var is now float $var += 2.5; //var is now integer $var += 2; //var is now string $var .= " is the total"; echo $var; ?> The above code outputs "4.5 is the total". Thanks... |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| scope variable | itbarota | HTML, CSS and Javascript Coding Techniques | 1 | 11-13-2007 12:29 AM |
| What is Value type and reference type in .Net? | anbuchezhians | VB.NET Programming | 2 | 08-21-2007 10:42 PM |
| Juggling in PHP? | raj | PHP Programming | 1 | 07-19-2007 08:04 AM |
| Static Global Variable and Static Local Variable | vigneshgets | C and C++ Programming | 1 | 05-30-2007 11:50 AM |
| Convert integer type variable to char array | oyu2o | C and C++ Programming | 0 | 03-10-2007 09:47 AM |