I'm using phpQuery to scrape some information from a page based on user input, but I'm trying to set up error handling if the user enters in something that doesn't exist.
For example, the user enters an incorrect product number it may result in
Warning: file_get_contents([function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in
What can I use in an if statement to check for a phpQuery error in an instance like this?
For example
if(...error...){
echo json_encode("error" => 'Incorrect value entered');
}