开发者

PHP doc 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 FALS开发者_高级运维E 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜