7 Blogger

สวัสดีเราเอง 7 ไง (จำไม่ได้เหรอ !?!?!)

September 25, 2008

Stupid Eval

Written by
7

สงสัยในความโง่ของตัวเอง อ่านตัวอย่างของ eval(); ใน Manual ไม่เข้าใจสักที มันเขียนยังงี้

 

ตัวอย่าง:
$string = ‘cup’;
$name = ‘coffee’;
$str = ‘This is a $string with my $name in it.’;
echo $str. “\n”;
eval (”\$str = \”$str\”;”);
echo $str. “\n”;

เขียนยังไงก็ไม่ได้ดังใจ มันใช้ยังไงฟะ error ตลอด หรือไม่ก็ output ผิด ทำไมมันใช้ยากใช้เย็นจังเฟ้ย เลยค้นๆถามๆ “อากู๋” ดู เจอตัวอย่าง code อีกแบบ

eval(”echo 1+1;”);

 

“เออ! กรูเข้าใจแระ”
“ขอโทษที่ผมโง่”

เรื่องที่เกี่ยวข้อง

  • No related posts
  • One comment for this post.

    1. Comment from CreamSeven on September 25th, 2008 :

      5555 วุ่นวายมาก ไอ้โค้ดพวกนี้

    Leave a Comment