How to convert string to int, or other variable to integer

To convert string to int in PHP you can use casting or intval() function. See example: $intVariable = intval( $unknownVariable ); // or: $intVariable = (int)$unknownVariable;You can cast with this function every php variable, like double. Remember that php can throw a error or warning, especially if variable is not set

Comments

Popular posts from this blog

How to construct a B+ tree with example

How to show only month and year fields in android Date-picker?

Visitor Counter Script Using PHP