This site uses cookies from Google to deliver its services, to personalize ads and to analyze traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies. Learn More

[SEO] Php Code for a Valid Number





Php Code for a Valid Number
Besides working on numbers, is_numeric( ) can also be applied to numeric strings. Use is_numeric( ):

if (is_numeric('five')) { /* false */ }
if (is_numeric(5)) { /* true */ }
if (is_numeric('5')) { /* true */ }
if (is_numeric(-5)) { /* true */ }
if (is_numeric('-5')) { /* true */ }
It is often useful to determine where in the code output originates.

Helpfully, is_numeric( ) properly parses decimal numbers, however, numbers with thousands separators, such as 5,100, cause is_numeric( ) to return false.

To strip the thousands separators from your number before calling is_numeric( ) use str_replace( ): is_numeric(str_replace($number, ',', '')); To check if your number is a specific type, there are a variety of self-explanatorily named related functions: is_bool( ) , is_float( ) (or is_double( ) or is_real( ); they're all the same), and is_int( ) (or is_integer( ) or is_long( )).

source : http://dailymotion.com, http://twitter.com, http://seo-tips-tech.blogspot.com

0 Response to "[SEO] Php Code for a Valid Number"

Posting Komentar

Contact

Nama

Email *

Pesan *