adspace


What does type casting mean in php? Explain with an example?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to calculate the difference between two dates using php?

1142


Tell me what kind of things have you done on the social side?

1063


How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain

1076


What sized websites have you worked on in the past?

1084


What is the current stable version of php? What advance thing in php7?

1093


What does $_files means?

1162


sort term descripttion form, report and uery

2254


What is difference between static and final in php?

1107


What is the current stable version of php?

1122


Which variable declarations within a class is invalid in php?

1046


Name and explain five of the PHP error constants?

1032


How to create a web form?

1109


List some features of php that are deprecated in php7?

1021


Write a program using while loop?

1115


Explain me is it possible to destroy a cookie?

1025