Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly does || mean?

return (empty($neededRole) || strcasecmp($role, 'admin') == 0 || strcasecmp($role, $neededRole) == 0);

What exactly does the || mean in this statement? Can someone put this in english for me.

I promise I've googled this but I guess I don't know what to google for because I can't find anything.

thanks:)

like image 222
BPD Avatar asked Mar 18 '26 21:03

BPD


1 Answers

It is the OR logicial operator.

http://www.php.net/manual/en/language.operators.logical.php

like image 119
Daniel A. White Avatar answered Mar 21 '26 09:03

Daniel A. White



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!