Title / Description
Code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Hello</title> </head> <body> <?php echo "Trust me!<br>\n"; echo "You can make it.<br>\n"; $a = 5; $b = &$a; echo $a . "<br/>\n"; echo $b . " !!<br/>\n"; $b = 10; echo $a . '<br/>'; echo $b . ' !!<br>'; $a = 20; echo $a . '<br/>'; echo $b . ' !!<br>'; echo (float) $b . '<br>'; $a = '12'; // $a 型別為 integer $a[0] = 'Hi!'; echo '<HR>'; echo $a . '<BR>'; $bb = 'Go'; $bb = (array) $bb; echo $bb[0] . '<BR>'; $bb[0] = 'N'; echo $bb[0] . '<br>'; echo '<HR>'; $c = '01'; echo '<p>' . $c . ' => ' . $c . '</p>'; $c++; echo '<p>' . $c++ . ' => ' . $c . '</p>'; $c = $c + 1; echo '<p>' . ($c + 1) . ' => ' . $c . '</p>'; class person { function who(){ echo 'I\'m Andy'; } function say(){ echo 'say what?'; } } $man = new person; $man->who(); echo ' '; $man->say(); echo '<hr>'; function suma(){ $a = 1; $b = 2; echo ($a + $b) . '<BR>'; } suma(); echo $a . '<BR>'; echo "\n"; $d = 10; function sumaa(){ global $d; echo $d . '<br>'; $d++; echo $d . '<br>'; } sumaa(); $d++; echo $d . '<BR>'; function mysum() { static $aaa = 1; if ($aaa < 20) { echo $aaa; $aaa++; mysum(); } } mysum(); echo '<HR>'; $f = '123'; $ff = (integer) $f; echo 'gettype "$ff" is : ' . gettype($ff) . ' and value is : '; echo $ff; echo '<HR>'; echo $_SERVER['HTTP_USER_AGENT'] . '<BR>'; echo $_SERVER['HTTP_HOST'] . '<BR>'; echo "<BR>\n"; echo "<pre>\n"; print_r($_SERVER); echo "</pre>\n"; ?> </body> </html>
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code