Q:

Write a PHP script to get the last occurred error

0

Write a PHP script to get the last occurred error.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
echo $x;
  print_r(error_get_last());
?>

Sample Output:

Array                                                       
(                                                           
    [type] => 8                                             
    [message] => Undefined variable: x                      
    [file] => /home/students/0d0149c0-f42e-11e6-a8c0-b738b9f
f32f9.php                                                   
    [line] => 2                                             
)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now