Jump to content

[SOLVED] changing data type


hasanatkazmi

Recommended Posts

how to declare $var as int in PHP: you don't.

 

secondly how to cast a variable  like () in PHP:

 

if you want the integer value of a string, use intval($string). If you need to determine if a value is a number, you can use is_numeric().

 

to test whether a value is an integer, I use

 

if (intval($string) == $string) {}

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.