- substr: documentation ( source)
- var_dump: documentation ( source)
- preg_grep: documentation ( source)
<?php
$numbers = ["12345", "12346", "12347", "12398"];
$input = "12498";
$arr = preg_grep("/". substr($input,0,3) . "/", $numbers);
Var_dump($arr);