Skip to content

Instantly share code, notes, and snippets.

@Kinghack
Created November 13, 2014 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kinghack/f6b1434a94bf21a80192 to your computer and use it in GitHub Desktop.
Save Kinghack/f6b1434a94bf21a80192 to your computer and use it in GitHub Desktop.
几个判断,应该还是第二种最好吧
if (isset($ad->sourceApp) && $ad->sourceApp != '1' && $ad->sourceApp != '2' ) return;
if (isset($ad->sourceApp) && !in_array(intval($ad->sourceApp), [1, 2])) return;
if (!(isset($ad->sourceApp) && ($ad->sourceApp == '1' || $ad->sourceApp == '2'))) return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment