Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
[PHP][JSON][ARRAY] How to show array vertical instead of horizontal
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Skythrust" data-source="post: 468491" data-attributes="member: 87030"><p>Hi there,</p><p></p><p>Since I am busy to create a new project I was wondering if there are possibilities to show an array vertical like the example below</p><p></p><p>[CODE]-- Horizontal view --</p><p>John Doe, Jane Doe, Jhon Doe</p><p></p><p>-- Vertical view --</p><p>John Doe</p><p>Jane Doe</p><p>Jhon Doe[/CODE]</p><p></p><p>This is the code which I am using now;</p><p></p><p>[CODE=php]<?php</p><p> $i =0;</p><p> echo "<table><tr>";</p><p> foreach($JsonstringPersons as $record)</p><p> {</p><p> if ($record['Online'] == 1) { $APBAreadiv = 'TextOn'; $APBCheck = 'checked'; } else { $APBAreadiv = 'TextOff'; $APBCheck = 'unchecked'; }</p><p></p><p> $i++;</p><p> echo "<td><div class=".$APBAreadiv.">"</p><p> .' '.$record['Firstname'] .' '. $record['Middlename'] .' '. $record['Lastname'];</p><p></p><p> echo</p><p></p><p> '</div> </p><p> </td>';</p><p> $i++;</p><p> if ($i % 5 == 0) { echo '</tr><tr>'; }</p><p> } </p><p> echo '</table>'; </p><p> }</p><p>?> [/CODE]</p></blockquote><p></p>
[QUOTE="Skythrust, post: 468491, member: 87030"] Hi there, Since I am busy to create a new project I was wondering if there are possibilities to show an array vertical like the example below [CODE]-- Horizontal view -- John Doe, Jane Doe, Jhon Doe -- Vertical view -- John Doe Jane Doe Jhon Doe[/CODE] This is the code which I am using now; [CODE=php]<?php $i =0; echo "<table><tr>"; foreach($JsonstringPersons as $record) { if ($record['Online'] == 1) { $APBAreadiv = 'TextOn'; $APBCheck = 'checked'; } else { $APBAreadiv = 'TextOff'; $APBCheck = 'unchecked'; } $i++; echo "<td><div class=".$APBAreadiv.">" .' '.$record['Firstname'] .' '. $record['Middlename'] .' '. $record['Lastname']; echo '</div> </td>'; $i++; if ($i % 5 == 0) { echo '</tr><tr>'; } } echo '</table>'; } ?> [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
[PHP][JSON][ARRAY] How to show array vertical instead of horizontal
Top