What does type casting mean in php? Explain with an example?
Answer / Pradeep Kumar Rai
Type casting in PHP is a way to explicitly convert data from one type to another. This can be achieved using various built-in functions such as (int), (float), (string), (boolean), (array) etc.nExample: To convert the value of a variable $x containing a string '5' into an integer, use the following statement:
n(int) $x;
After executing this, the value of $x will be 5.
| Is This Answer Correct ? | 0 Yes | 0 No |
How to find a substring from a given string in php?
What is the use of array_count_values() in php?
How many records can be stored in mysql table?
How long is csrf token?
What is the difference between the functions unlink and unset?
Explain how you can update memcached when you make changes to php?
Is php faster than javascript?
What is a trait in php?
Which function would you use to insert a record into a database in php?
Do you know how to enable error reporting in php?
When sessions ends?
What is the main function of php?