문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top