Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: PHP  |  size: 0.23 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     public function is_url(){
  2.         $url = $this->input->post('url');
  3.         $headers = get_headers($url);
  4.         $headers = preg_match('/^HTTP\/\d\.\d\s+(200|301|302)/', $headers[0]);
  5.         return $headers == 1 ? true : false;
  6.     }