Jump to content

[SOLVED] exception help


snowman15

Recommended Posts

i need to format my exception with this funciton but I dont know where to put it!

 

 

function that formats:

function formatException(Exception $e)
  {
    return "Error {$e->getCode()}: {$e->getMessage()} " .
          "(line: {$e->getline()} of {$e->getfile()})";
  }

 

 

try:catch block  Where do i put the function?

try {
   $answer=average($myString); 
   echo $answer."<br />";
} 
catch (Exception $em) 
{
    echo $em."<br />";
} 

Link to comment
https://forums.phpfreaks.com/topic/75689-solved-exception-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.