This PHP function extracts all numbers from a String and prints them as a comma separated list of numbers. Ready to use function to use in your PHP Scripts and projects.
<?php
function extractAllNumbersFromString($string)
{
preg_match_all('!\d+!', $string, $matches);
$list = implode(',', $matches[0]);
return $list;
} // End of function for "Extracting all numbers from a String"
// Using the function to Extract all numbers from a String
// Put your test string here
$URL="This is text with 10 27 45 and something else like 5 and 7.";
echo extractAllNumbersFromString($URL)
?>
PHP Script to create URL from string. It retails only URL Safe characters in the strings. So, now easily create...
100% Free PHP folder to gallery script. Just give the name of folder and it will generate gallery of all...
PHP Script to extract all links from a web page. This PHP Snippet reads the contents of a web page...
This is a simple function written in PHP to generate keywords from any text. Just pass any free text to...
This PHP Code snippet lists all files in a folder and hyperlinks them accordingly. Very clean, easy to use function....
This is a simple PHP function to parse text provided and automatically hyperlink the links in the text.
PHP Script to create thumbnail of any image (.jpg, .png and .gif). This create thumbnail function is ready to use....
It is a very nice PHP time ago function. You gave pass any date to it and it will tell...