Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php keep only numbers in string

$str = preg_replace('/[^0-9.]+/', '', $str);
Comment

php get only numbers from string

$str = 'In My Cart : 11 items';
$int = (int) filter_var($str, FILTER_SANITIZE_NUMBER_INT);
Comment

PREVIOUS NEXT
Code Example
Php :: php get current domain 
Php :: htaccess post max size 
Php :: php get current date and time 
Php :: pdo last insert id 
Php :: wordpress get theme uri 
Php :: check all php version installed ubuntu 
Php :: wordpress error log 
Php :: how to validate an email field using php 
Php :: php time script 
Php :: bcmath php extension in ubuntu 
Php :: the_post_thumbnail add class 
Php :: laravel generate env 
Php :: laravel show routes artisan 
Php :: laravel migrate fresh and seed 
Php :: php get type of object 
Php :: laravel foreach else 
Php :: serve php file 
Php :: shop page url woocommerce 
Php :: check if valid url php 
Php :: laravel table data types 
Php :: php get latest file in directory 
Php :: +1 month php 
Php :: php timezone asia dhaka 
Php :: php filter email 
Php :: get the list of php versions installed 
Php :: laravel blade errors all 
Php :: laravel clear all cache 
Php :: call seeder laravel 
Php :: laravel insert or ignore 
Php :: php find keyword in string 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =