PHP ÖÐ×Ô¶¨Ò庯ÊýµÄ¼¸ÖÖ·½Ê½
PHPÖÐͨ³£Óм¸ÖÖ×Ô¶¨Ò庯ÊýµÄ·½·¨£¬ÏÂÃæ½éÉÜһϣ¬ÎÒÃÇʹÓõÄÊÇÕâÖÖ·½Ê½£º
<?php
function foo($arg)
{
return $arg
}
?>
µ±Ä³Ð©²ÎÊýΪ¿ÉÑ¡ÊÇ£¬¿ÉÒÔÕâÑù¶¨Ò壺
<?php
function foo($arg = NULL)
{
return $arg == NULL ? "" : $arg;
}
?>
µ±ÎÒÃDz»ÏÞÖÆ²ÎÊý¸öÊýµÄʱºò£¬Ò²¿ÉÒÔÕâÑù¶¨Ò壺
<?php
function foo()
{
$args = func_get_args();
return (count($args) > 0) ? $args : "";
}
?>
Ïà¹ØÎĵµ£º
[root@BIND9-master /usr/local/bin]# php --ini
Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File: /usr/local/Zend/etc/php.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed: &n ......
Ò»£¬PHP½Å±¾´úÂë±ê¼Ç
PHPµÄ½Å±¾ÊÇÎļþÖÐÒ»¶ÔÌØÊâ±ê¼ÇËù°üÀ¨µÄÄÚÈÝ£¬ÈçASPÊÇ“<%....%>”,PHP¿É¿´³ÉÊÇ“<?...?>”¡£
È»¶øÎªÁËÊÊÓ¦XML±ê×¼ÒÔ½«PHPǶÈëµ½XML»òXHTMLÖУ¬PHP²»½¨ÒéʹÓö̸ñʽµÄ“<?...?>”£¬¶ø½¨ÒéʹÓó¤¸ñʽ±ê¼Ç“<?php...?>”
´ËÍâPHP´úÂ ......
Sometimes, you might want to get the current page URL that is shown
in the browser URL window. For example if you want to let your visitors
submit a blog post to Digg you need to get that same exact URL. There
are plenty of other reasons as well. Here is how you can do that.
Add the followin ......
¹úÍâµÄ¿ªÔ´¼¼ÊõÒ²Ó°ÏìºÍÍÆ¶¯Á˹úÄÚ¿ªÔ´³ÌÐòµÄ·¢Õ¹£¬ÉÏÎÄÎÒ½éÉܵġ¶¹úÍâÓÅÐ㿪ԴPHP½¨Õ¾³ÌÐòÒ»ÀÀ¡·ÖУ¬ºÜ¶à¹úÍ⿪Դ³ÌÐò²¢²»Ì«·ûºÏÖйúÈ˵ÄʹÓÃϰ¹ß£¬¶ø¹úÄÚÓÐһЩ³§¼Ò»ò¸öÈËÒ²×öÁËһЩ²»´íµÄ²úÆ·£¬²»ÉÙ³ÌÐòÊÇÌṩԴ´úÂëÏÂÔØµÄ£¬ËäÈ»ÓÐЩÔÚÐí¿ÉÐÒéÉϺͿªÔ´Ðí¿ÉÖ¤ÓÐЩ³öÈ룬µ«ÆäÔÚʹÓÃÉÏ»¹ÊÇͦ·ûºÏÖйúÈ˵ÄʹÓÃϰ¹ß£¬½ñÌìÎÒ¾ ......
ÏÂÃæ½éÉܼ¸ÖÖPHPÖÐÅжϡ¢Ñ»·µÄ¼¸ÖÖд·¨¡£
×îÆÕͨµÄÅжϣº
<?php
if( $args != NULL )
{
call_func($args);
}
?>
¶ÔÓÚµ¥ÐеÄÖ´ÐÐÓï¾ä£¬¿ÉÒÔд³É£º
<?php
if( $args != NULL ) call_func($args);
?>
Ò²¿ÉÒÔʹÓÃÒýºÅµÄ·½Ê½¡£
<?php
if( $args != NULL ):
call_func($args);
......