𝌔 Fossil Hub
Login | Fossil manual |
array traversal tutorial

Check-in [dc5d60e97f]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added small [link] for the currently shown json/array
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1:dc5d60e97f22d61db7824b33138e79b192dc2981
User & Date: mario 2012-01-10 21:34:51
Context
2012-01-10
21:34
Added small [link] for the currently shown json/array Leaf check-in: dc5d60e97f user: mario tags: trunk
05:23
phptags -w -c check-in: 601bdec8cb user: mario tags: trunk
Changes

Changes to index.php.

51
52
53
54
55
56
57



58
59
60
61
62
63
64
         
         #-- foreach
         if (@($_REQUEST["foreach"])) {
             print "<h1>How to loop over this structure</h1>\n";
             print foreach_r_js($data);
             print "<p>Note that this auto-generated loop might only work if the array/object structure is very uniform (no discrepancies in subarray schemes). It also might skip consecutive indexed array levels.</p>";
         }



     ?>

     <article>
        <p>
        Also check the manual on <a href="http://php.net/manual/en/language.types.array.php"><tt>array</tt> syntax</a>
        and how to work with <a href="http://php.net/manual/en/language.types.object.php"><tt>objects</tt></a>.<br>
        Or how to use a <a href="http://php.net/foreach"><tt>foreach</tt></a> to loop over entries.







>
>
>







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
         
         #-- foreach
         if (@($_REQUEST["foreach"])) {
             print "<h1>How to loop over this structure</h1>\n";
             print foreach_r_js($data);
             print "<p>Note that this auto-generated loop might only work if the array/object structure is very uniform (no discrepancies in subarray schemes). It also might skip consecutive indexed array levels.</p>";
         }
         
         #-- copy link
         print "<p><br><a style='opacity:0.1' href='http://array.include-once.org/?foreach=".isset($_REQUEST["foreach"])."&assoc=".isset($_REQUEST["assoc"])."&json=".urlencode($_REQUEST["json"])."'>link</a>";
     ?>

     <article>
        <p>
        Also check the manual on <a href="http://php.net/manual/en/language.types.array.php"><tt>array</tt> syntax</a>
        and how to work with <a href="http://php.net/manual/en/language.types.object.php"><tt>objects</tt></a>.<br>
        Or how to use a <a href="http://php.net/foreach"><tt>foreach</tt></a> to loop over entries.