Jump to content

Custom Error Message


The Little Guy

Recommended Posts

I have a method, where I want the first value to be an array, if the value isn't an array that is added, how can I alert them?

 

For example if I pass a string to the parameters for array_merge, I get an error:

 

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/ryannaddy/ryannaddy.com/BotStop/examples/mailbot.php on line 29

 

So say I have this index.php:

$mail->mail('cat', 'dog');  // Line 12

 

then in the class I have this MyClass.php:

public function mail($v1, v2){  // Line 211
    if(!is_array($v1)){
        // trigger some sort of error saying that they Argument #1 is not an array in index.php on line 12
    }
}

 

if you read my comments in the above two it will make some sense. Any way how can I get a message like that to occur?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.