วันพุธที่ 30 เมษายน พ.ศ. 2557

13:55

ฟังก์ชัน next() 
การใช้ฟังก์ชัน next() เพื่อขยับการชี้ไปที่ element ถัดไป



ตัวอย่าง
$city=array('tokyo','new york','Vancouver','Wellington','Christchurch');
next($city); // <---- ขยับไปหนึ่ง element 
next($city); // <---- ขยับไปหนึ่ง element 
next($city); // <---- ขยับไปหนึ่ง element 
print current($city); // <---- จะพิมพ์ Wellington

0 ความคิดเห็น:

แสดงความคิดเห็น

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.