Answers for "remove all words in string and to number php"

PHP
1

php remove numbers from string

$words = preg_replace('/[0-9]+/', '', $words);
Posted by: Guest on September-25-2020
0

php remove all but numbers

// Original SOA
preg_replace('/[^0-9]/', '', '604-619-5135'); // Removes the dahses in 604-619-5135

preg_replace('/[^0-9]/', '', '7#sq7k*77dql'); // = 7777
Posted by: Guest on May-31-2021
0

how to remove words in contain integer php

$input = "H3llo This is a? #test e3ample of a sentence-word bl&h.";
echo preg_replace('/(?=[^ ]*[^A-Za-z \'-])([^ ]*)(?:\\s+|$)/', '', $input);

This is of a sentence-word
Posted by: Guest on December-15-2020

Code answers related to "remove all words in string and to number php"

Browse Popular Code Answers by Language