|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-06-29 22:57 UTC] jim at cvs dot php dot net
[1999-06-30 09:01 UTC] codemaster at randombytes dot com
[1999-06-30 12:08 UTC] jim at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Jun 30 09:00:02 2026 UTC |
<table border=3> <tr><th colspan=6>Original array = ("abc", "def", "ghi", "jkl", "stuck", "together")</th></tr> <tr bgcolor=ff0000> <th>0 = undef <th>1 = undef <th>2 = undef <th>3 = undef <th>4 = undef <th>5 = undef </tr> <tr bgcolor=ffff88> <!-- *** PART 1 *** --> <?php $x = array("abc", "def", "ghi", "jkl", "stuck", "together"); for ($i = 0; $i < count($x); $i++) { echo "<td valign=top>"; $temp = $x[$i]; $x[$i] = $y; echo implode("<br>", $x); $x[$i] = $temp; echo "</td>"; } ?> </tr> <tr><th colspan=6>Original array = array($y)</th></tr> <tr bgcolor=ff0000> <th>1 items <th>2 items <th>3 items <th>4 items <th>5 items <th>6 items </tr> <tr bgcolor=ffff88> <!-- *** PART 2 *** --> <?php $x = array($y); for ($i = 1; $i < 7; $i++) { echo "<td valign=top>"; $x[$i] = "item$i"; echo implode("<br>", $x); echo "</td>"; } ?> </tr> <tr><th colspan=6>Original array = array("abc", "def", "ghi", "jkl", "mno", "pqr", "stu", "vwx", "123", "456", "789")</th></tr> <tr bgcolor=ff0000> <th>1 undef <th>2 undefs <th>3 undefs <th>4 undefs <th>5 undefs <th>6 undefs </tr> <tr bgcolor=ffff88> <!-- *** PART 3 *** --> <?php $x = array("abc", "def", "ghi", "jkl", "mno", "pqr", "stu", "vwx", "123", "456", "789"); for ($i = 0; $i < count($x); $i++) { echo "<td valign=top>"; $x[$i] = $y; echo implode("<br>", $x); echo "</td>"; } ?> </tr> </table>