Thursday, 28 April 2011

Extract only numeric value from a string through Regular Expression

$TextVariable = 'Dummy54Da69ta';
$NumericVal = preg_replace("/[^0-9]+/","",$TextVariable);
echo $NumericVal;

No comments:

Post a Comment