9 Useful PHP Functions and Features You Need to Know | Nettuts 知ã£ã¨ãã¨ä¾¿åˆ©ãªPHPã®ãƒ†ã‚¯ãƒ‹ãƒƒã‚¯ï¼™ã¤ãŒæŽ²è¼‰ã•ã‚Œã¦ã„ã¾ã—ãŸã€‚ åˆå¿ƒè€…ã®æ–¹ã¯å‹¿è«–ã€PHPを長年使ã£ã¦ã‚‹äººã«ã‚‚使ãˆã‚‹ãƒ†ã‚¯ãƒ‹ãƒƒã‚¯ãŒè¼‰ã£ã¦ã„ã¾ã—ãŸã®ã§å‹‰å¼·ãŒã¦ã‚‰ã«ãƒ¡ãƒ¢ã€‚ func_get_args() 関数ã§å¯å¤‰å¼•æ•°Â ã‚’å—ã‘å–ã‚‹ 通常ã€é–¢æ•°ã¨ã„ãˆã°ã€æ¬¡ã®ã‚ˆã†ã«å¼•æ•°ã¨å…±ã«å®šç¾©ã—ã¾ã™ã€‚ function hoge($arg1, $arg2) { } ã®ã‚ˆã†ã«å®šç¾©ã—ã¦å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã™ãŒã€å¥½ããªå€‹æ•°ã§å¼•æ•°ã‚’å—ã‘å–ã‚ŠãŸã„å ´åˆã¯ã€æ¬¡ã®ã‚ˆã†ã«func_get_argsã§å—ã‘å–ã‚Œã¾ã™ã€‚ function hoge() { $args = func_get_args(); foreach ($args as $key=>$value) { echo "arg{$key} is $value
{{#tags}}- {{label}}
{{/tags}}