正規表現で、とにかく http で始まる URL らしきものの取得


  PHP



<?php
header( "Content-Type: text/html; Charset=utf-8" );
header( "pragma: no-cache" );
header( "Expires: Wed, 31 May 2000 14:59:58 GMT" );
header( "Cache-control: no-cache" );
//Cache-Control: private, no-store, no-cache, must-revalidate

$result = file_get_contents("http://gigazine.net/");

preg_match_all("|(https?://.+?)[\"']?[;)>\\s]|u", $result, $matches, PREG_PATTERN_ORDER );

print "<pre>";
foreach( $matches[1] as $value ) {
	print($value . "\n");
}
print "</pre>";


?>











  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ