Спустя 27 минут, 36 секунд (28.09.2011 - 22:05) alex12060 написал(а):
$fp = fopen('test.html', 'r');
$n = 0;
while(!feof($fp)) {
$n += is_int(stripos(fgets($fp, 4096), '<script')) ? 1 : 0;
}
echo $n;
fclose($fp);
Тест проводил тут:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<script language="javascript" src="./html/quote.js"></script>
<script language="JavaScript1.2">
<!--
var ns6=document.getElementById&&!document.all?1:0
var head="display:''"
var folder=''
function expandit(curobj){
folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style
if (folder.display=="none")
folder.display=""
else
folder.display="none"
}
//-->
</script>
<style type="text/css">
#text {
}
#text #sub {
color: #fa2351;
}
#text #sub #date {
text-decoration: underline
}
</style>
<script type="text/javascript">
window.onload = function() {}
</script>
<script>
alert(null);
</script>
</head>
<body>
<div id="text">
<div id="sub">
<p>dsdgsdgsdhshsdh</p>
<span id="date">13.02.2011</span>
</div>
</div>
<div>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-4951956-3");
pageTracker._trackPageview();
} catch(err) {}</script></div>
</body>
</html>
Ответ верен. 5.
Спустя 23 часа, 32 минуты, 42 секунды (29.09.2011 - 21:38) Guest написал(а):
спасибо!!!очень ценный совет)))