Forum Moderators: coopster
I am with a problem in a script that I did.
I want to catch the links of a page html.
I did the whole page and i want to catch all that it is between href=""
Script that I did:
------------------------------
$page = "<html>
<head>
<title>Testing</title>
</head>
<body>
testing <a href='link--here' class='t'>link here</a> testing...testing <a href='link--here' class='t'>link here</a> testing...testing <a href='link--here' class='t'>link here</a> testing...testing <a href='link--here' class='t'>link here</a> testing...
</body>
</html>"
preg_match_all("¦<a href='(.*)' class='t'>]+>¦U", $page, $out);
print_r($out);
----------------------------------
It would like that the result was something as:
Link--here
Link--here
Link--here
...
Only that I do not am an expert in regular expression, and it is giving mistake in the line 18 - preg_match_all line
It would like to know they can help.
Sorry my english.