[ create a new paste ] login | about

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

karimkhan - PHP, pasted on Nov 26:
1
2
3
4
5
6
7
8
9
10
11
<?php
    $url='http://www.ndtv.com/';
    $data = file_get_contents($url);
    $title = get_title($data);
    echo $title;
    function get_title($html) 
    	{
    		return preg_match('!<title>(.*?)</title>!i', $html, $matches) ? $matches[1] : '';
    	}

?>


Output:
1
2
3
4

Warning: file_get_contents(http://www.ndtv.com/): failed to open stream: No such file or directory on line 3

Warning: preg_match(): Internal pcre_fullinfo() error -3 on line 8


Create a new paste based on this one


Comments: