# PHP fetch a specific value that begins with a given number from a string with letters and numbers?

PHPServer Side ProgrammingProgramming

Let’s say the following is our string with letters and numbers −

$value ="1045632245555fghjklm67535454663443gfdjkbvc9890000006777743"; We ant a specific value beginning from 989 i.e.− 9890000006777743 ## Example For this, use substr() along with strpos(). Live Demo <!DOCTYPE html> <html> <body> <?php$value ="1045632245555fghjklm67535454663443gfdjkbvc9890000006777743";
echo "The actual value is=",$value,"<br>";$result=substr($value, strpos($value,"989"), 16);
echo "The filter value is=",\$result;
?>
</body>
</html>

## Output

The actual value is=1045632245555fghjklm67535454663443gfdjkbvc9890000006777743
The filter value is=9890000006777743
Updated on 13-Oct-2020 07:02:42