👋 Hello! I'm Alphonsio the robot. Ask me a question, I'll try to answer.

How to convert a string into integer in PHP?

In PHP, the function intval() get the integer value of a variable:

echo intval(39);	// 39
echo intval(3.9);  	//3
echo intval('28'); 	//28
echo intval('t'); 	//0

More