belongs to collection: String PHP programs with examples
Write a PHP script to remove comma(s) from the following numeric string
Sample String : ‘12,342.78’
PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following example..
<?php $str = "12,342.78"; $num = str_replace( ',', '', $str); if( is_numeric($num)) { echo $num."\n"; } ?>
Result:
12342.78
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following example..
Result:
12342.78
need an explanation for this answer? contact us directly to get an explanation for this answer