$fp=fopen("/tmp/result.txt","w");
fputs($fp,$k_text);
fclose($fp);
echo "The text was output into /tmp/result.txt.";
?>
SetKanjiOutput("EUC"); /* ブラウザに EUC で表示 */ ?>
PHP3 with GD
/* Allocate the image: 64 pixels across by 64 pixels tall */
$im = ImageCreate(100, 100);
/* Allocate the color black (red, green and blue all minimum).
Since this is the first color in a new image, it will
be the background color. */
$black = ImageColorAllocate($im, 0, 0, 0);
/* Allocate the color white (red, green and blue all maximum). */
$white = ImageColorAllocate($im, 255, 255, 255);
$red = ImageColorAllocate($im, 255, 0, 0);
$green = ImageColorAllocate($im, 0, 255, 0);
$blue = ImageColorAllocate($im, 0, 0, 255);
$yellow = ImageColorAllocate($im, 255, 215, 0);
/* Draw a line from the upper left to the lower right,
using white color index. */
ImageLine($im, 0, 0, 50, 50, $white);
ImageLine($im, 100, 0, 50, 50, $yellow);
ImageLine($im, 100, 100, 50, 50, $red);
ImageLine($im, 0, 100, 50, 50, $green);
ImageKanjiChar($im, 5, 50, 50, "ん", $red);
ImageKanjiCharUp($im, 5, 50, 50, "ん", $white);
ImageString($im, 2, 20, 20, "あaいbうc", $red);
ImageStringUp($im, 2, 70, 70, "あaいbうc", $white);
ImageSetKanjiFont("goth");
ImageString($im, 3, 25, 85, "aこれgoth", $yellow);
ImageStringUp($im, 3, 10, 90, "aこれgoth", $yellow);
ImageSetKanjiFont("min");
ImageString($im, 5, 0, 0, "abあいうc", $blue);
ImageStringUp($im, 5, 85, 85, "abあいうc", $green);
/* Open a file for writing. */
$now= Date("YmdHis", getLastMod());
$out = "tmp/test$now.gif";
/* Unlink("$out"); */
/* Output the image to the disk file. */
ImageGif($im, $out);
/* Destroy the image in memory. */
ImageDestroy($im);
?>
このページは echo Date("Y-m-d(D) H:i:s", getLastMod()) ?>に更新されました。
ただ今、 echo Date("Y年m月-d日(D) H時i分s秒", Time()) ?>です。