Try a regular expression !! Urgent! 100 classification with a connection similar to this: & lt; a & nbsp; & nbsp; find a regular expression and try it !! Urgent! 100 classification tape
A connection like this:
Href = "http: // url" target = "_ blank"> title
Or
Href = "http: // url"> title
And so on:
I need to use preg_match_all to get a url and a title. array.
Waiting. hope to enlighten me. score immediately
------ Solution --------------------
#] + Href = (['\ "]?) (. +) \ 1 [^>] *> (. *) <\/a> # isU
------ Solution --------------------
Preg_match_all ('/] + href [\ s \ r \ n] * = [\ s \ r \ n] * ([' \ "]?) (. +) \ 1 [^>] *> (. +) <\/a>/isU ', $ text, $ matches );
------ Solution --------------------
@ Href = "(. *)". *> (.*)
Example:
$ Str = < Href = "http: // url" target = "_ blank"> title
Or
Href = "http: // url"> title
EOF;
Preg_match_all ("@ href = \" (. *) \ ". *> (.*)
Print_r ('
');
Print_r ($ matches );
?>
Output:
Array
(
[0] => Array
(
[0] => href = "http: // url" target = "_ blank"> title
[1] => href = "http: // url"> title
)
[1] => Array
(
[0] => http: // url
[1] => http: // url
)
[2] => Array
(
[0] => title
[1] => title
)
)