Search
 
SCRIPT & CODE EXAMPLE
 

PHP

remove comma in numeric in php

$var = 18,542.00;
$var = intval(preg_replace('/[^d.]/', '', $var));
result :- 18542;
or if you need float
$var = floatval(preg_replace('/[^d.]/', '', $var));
result :- 18542.00;
Comment

remove string after comma in php

preg_replace('/^([^,]*).*$/', '$1', $print);
substr($string, 0, strrpos($string.",", ","));
Comment

PREVIOUS NEXT
Code Example
Php :: php nginx file not found 
Php :: why storage link do not work in host for laravel 
Php :: wp query search 
Php :: php rand vs mt_rand 
Php :: wordpress 404.php redirect to home 
Php :: wordpress get user profile picture 
Php :: php get object class 
Php :: how to change php variable value in javascript 
Php :: php encrypt decrypt url parameters 
Php :: Add WooCommerce Price Suffix 
Php :: laravel detach 
Php :: drop column migration laravel 
Php :: send email in php 
Php :: laravel create new file if not exists 
Php :: validation file in laravel 
Php :: upload multiple files in codeigniter 
Php :: laravel migration remove nullable 
Php :: mysqli_connect php 
Php :: Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php 
Php :: Group by not working - Laravel 
Php :: how to log object laravel logger 
Php :: laravel blade @selected 
Php :: combine 2 columns search query laravel 
Php :: how to make a config file for php 
Php :: php multi condition if 
Php :: pluck laravel 
Php :: wp main menu 
Php :: get authinticated user id laravel 
Php :: laravel pagination problem in blade 
Php :: ini_set php 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =