Jump to content

Very quick question


eugeniu

Recommended Posts

I found this bit of code in an example script that seems to use strlen as a function that outputs true or false:

 

if (!$item || strlen($item = trim($item)) == 0) { ...

 

Is that code valid? For me, it seems to do what it's supposed to, determine if $item is set, but how does it actually do that? And... what is the use for trim here?

Link to comment
https://forums.phpfreaks.com/topic/166467-very-quick-question/
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.