Posts Tagged ‘exception in php’
Check Site Loading Speed using CURL curl_getinfo() in PHP.
Monday, June 22, 2009 10:06 3 CommentsWe use curl_getinfo() in to get the information of last transfer that made use of curl functions in PHP. Using the following code we can get the time taken to load a webpage. $ch = curl_init(‘http://www.inetminds.com/parsing-xml-feeds-in-php-with-simplexml-111/’); // set cURL to return the contents in a variable instead of giving it to the browser. curl_setopt($ch, CURLOPT_RETURNTRANSFER, [...]
throw Exception in php
Friday, October 31, 2008 9:52 No Commentstry { doExchange(); throw new Exception(“D’oh!”); echo “hai”; } catch (Exception $except) { logger.error(“doExchange failed”, e); } In that example, PHP enters the “try” block and starts executing code. When it hits the line “throw new Exception”, it will stop executing the “try” block, and jump to the “catch” block. Here it checks each exception [...]
try and catch block in php
Thursday, October 30, 2008 8:47 1 CommentException handling is used to change the normal flow of the code execution if a specified error (exceptional) condition occurs. This condition is called an exception. Try block is used to try for the code to execute if any error like file unable to open etc.. It will stop the execution and it will throw [...]
