<?php
$text = "<link type='text/css' rel='stylesheet' href='http://may.be/Qq5OFFlUulT.css' />
<link rel='canonical' href='http://www.ma.y.be/gh/y/u/sdfh/o/' />";
preg_match_all('#<link.+(?:href|rel)=((?:\'|")(.*)(?:\'|")|(?:\'|")stylesheet(?:\'|"))([^>"\'\s]+).*>#iuUs', $text, $match);
echo '<pre>'.htmlspecialchars(print_r($match, 1)).'</pre>';
?>
???
Спустя 1 час, 14 минут, 24 секунды (20.03.2012 - 15:34) killer8080 написал(а):
Эли4ка держи 

$text = "
<link type='text/css' rel='stylesheet' href='http://may.be/Qq5OFFlUulT.css' />
<link rel='stylesheet' href='http://tttT.css' type='text/css' />
<link href=\"http://hfhfhf.css\" type='text/css' />
<link href=http://aaaaa.css type='text/css' />
<link rel='canonical' href='http://www.ma.y.be/gh/y/u/sdfh/o/' />";
preg_match_all('#<link.+(?|(?:text.css.+href=(?:["\']?)([^"\'\s]+?)(?:["\']?))|(?:href=(?:["\']?)([^"\'\s]+?)(?:["\']?).+text.css)).*>#iuUs', $text, $match);
echo '<pre>'.htmlspecialchars(print_r($match, 1)).'</pre>';
Спустя 13 часов, 8 минут, 20 секунд (21.03.2012 - 04:42) Эли4ка написал(а):
ну почему,почему у меня не получаются эти регулярные выражения..и теорию смотрю,и примеры..все в одни ворота..
killer8080
спасибо.




killer8080
спасибо.