php string to int

by Ramya 2009-10-10 09:42:54

php string to int:

To convert php string to int we need to follow type casting. Just use (int) before a variable name or string name.

Use:
(int)string name

For example:
<?php
$str = "10897";
$num = (int)$str;
?>

Tagged in:

1265
like
0
dislike
0
mail
flag

You must LOGIN to add comments