Detecting a 500 error in php

Discussion in 'PHP' started by projectWORD, Aug 3, 2008.

  1. #1
    Hi, I run this code:-

    if (get_meta_tags($url)) { echo $tags['description'];
    }

    Which is fine but if the url is a broken link or something, it will return an error.
    How can I prevent this?
     
    projectWORD, Aug 3, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    if ($tags = @get_meta_tags($url))
    {
        echo $tags['description'];
    }
    
    PHP:
     
    nico_swd, Aug 3, 2008 IP