Zanda: regex

Beitrag lesen

<?php
error_reporting(E_ALL);

$string = <<<EOF
<a href="/what/ever/1234.htm">INHALT</a><br>Quatsch</p><a href="/what/ever/12345.htm">INHALT2</a><br>Quatsch</p>
EOF;

$pattern = '/.*<A\W*HREF="(.+?)">(.+?)</A>.*/';
preg_match_all($pattern, $string, $array);

echo '<pre>', print_r($array, true), '</pre>';

?>

bringt leider nur!:

Array
(
    [0] => Array
        (
        )

[1] => Array
        (
        )

[2] => Array
        (
        )

)

Danke
Zanda