How can you extract and filter house numbers from an address using PHP?

To extract and filter house numbers from an address using PHP, you can utilize regular expressions to match and extract the numeric values that represent house numbers. By using a regular expression pattern that targets house numbers, you can filter out any non-numeric characters and extract only the relevant information.

$address = "123 Main Street";
$house_number = preg_replace('/\D/', '', $address);

echo $house_number; // Output: 123