[ create a new paste ] login | about

Link: http://codepad.org/VKUeYUV9    [ raw code | output | fork ]

PHP, pasted on Oct 9:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
	$url="http://open2ch.net/dev/toukei.cgi?m=thread&d=2015-10-09&bbs=news4vip&sort=time";
	//タイムオーバー防ぐ
	set_time_limit(0);
	
	//UAを設定
	$options = array(
	'http' => array(
	'method' => 'GET',
	'header' => 'User-Agent: test)',),
	);
	
	//統計君取得
	$context  = stream_context_create($options);
	$contents = file_get_contents($url, false, $context);
	print("<meta charset=\"utf-8\">");//文字化けしないように
	print($contents);//表示


Output:
1
2
3

Warning: file_get_contents(http://open2ch.net/dev/toukei.cgi?m=thread&d=2015-10-09&bbs=news4vip&sort=time): failed to open stream: No such file or directory on line 15
<meta charset="utf-8">


Create a new paste based on this one


Comments: