Skip to content

Instantly share code, notes, and snippets.

@elct9620
Created December 27, 2011 15:39
Show Gist options
  • Save elct9620/1524052 to your computer and use it in GitHub Desktop.
Save elct9620/1524052 to your computer and use it in GitHub Desktop.
PHP Switch 新用法
<?php
$array = array('type', 'apple');
switch(true){
case in_array('apple', $array):
echo 'Have Apple';
case in_array('mango', $array):
echo 'Have Mongo';
default:
}
?>
@elct9620
Copy link
Author

過一段時間回來看發現其實這做法應該會⋯⋯很慢 Orz
每次都做 Function Call 會悲劇吧 XDD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment