PHP ʖ²ἯTH
º/A
Ղ 13. º¯ʽ
±䁿º¯ʽ
±䁿º¯ʽ²»ĜӃӚӯє½ṹ£¬=ȧ echo()¡¢print()¡¢unset()¡¢isset()¡¢empty()¡¢include()¡¢require() Ҕ¼° ˆµēᄂ¡£ĺШҪʹӃĺה¼ºµč⿇º¯ʽ4½«բЩ½ṹӃ±䁿º¯ʽ¡£
=ד 13-3. ±䁿º¯ʽʾ=
?php function foo() {echo "In foo() br \n";} function bar($arg = '') {echo "In bar(); argument was '$arg'. br \n";} // This is a wrapper function around echo function echoit($string) {echo $string;} $func = 'foo'; $func(); // This calls foo() $func = 'bar'; $func('test'); // This calls bar() $func = 'echoit'; $func('test'); // This calls echoit()?
=ד 13-4. ±䁿·½·¨·¶=
?php class Foo {function Var() {$name = 'Bar'; $this- $name(); // This calls the Bar() method} function Bar() {echo "This is Bar";}} $foo = new Foo(); $funcname = "Var"; $foo- $varname(); // This calls $foo- Var()?
º/A
ưµ㼯A
¾ɵĺ¯ʽ
ɏһ¼¶
ӫ¶ԏD