Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getAddress( $url )
- {
- if( function_exists( 'curl_init' ) )
- {
- $cURL = curl_init( $url );
- if(curl_setopt( $cURL, CURLOPT_RETURNTRANSFER, true ))
- {
- curl_setopt( $cURL, CURLOPT_FOLLOWLOCATION, true );
- $address = curl_exec( $cURL );
- curl_close( $cURL );
- }
- else
- {
- $address = @file_get_contents( $url );
- }
- }
- else
- {
- $address = file_get_contents( $url );
- }
- if( !$address )
- {
- return false;
- }
- else
- {
- return trim($address);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement