Here is a string -: RT4646R@TWBNSN3234FHFHFH893892389FHDJJD$
Now How will find all red marked numbers in an Array.Here is solution.
<?php
$string = 'RT4646R@TWBNSN3234FHFHFH893892389FHDJJD$';
$special_char = '\[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]';
preg_match_all('/\d+/', $string,$output);
echo '<pre>';
print_r($output[0]);
?>
No comments:
Post a Comment