Question

I was reading the doc on the imagefilter and was wondering what does it mean when it reads. What should I expect to see when either occurs?

Returns TRUE on success or FALSE on failure

Was it helpful?

Solution

Exactly what it says.

If the function succeeds, it returns the boolean value true, and if it fails, the boolean value false. You won't "see" anything unless you echo the result of the function, at which point the boolean value will be converted to a string, and then will read true or false.

You can use this value anywhere you need a boolean. For example.... suppose I have a function, myFunction(), and it returns "true on success or false on failure" just like whatever function you are using. You could do this:

if (myFunction()) {
    echo "The call to myFunction() succeeded!";
} else {
    echo "The call to myFunction() failed!";
}

Specifically in the case of your imagefilter() function, it doesn't return an image. All of the work is done on the image referenced by the first parameter. It only returns true or false, just like it says.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top