Welcome Guest, Not a member yet? Register   Sign In
JSON Decode Array
#4

[eluser]CroNiX[/eluser]
As a side, It usually looks much cleaner if you use the php alternative control structures when using HTML in your views. It also helps a lot of IDEs recognize the HTML as HTML since it's not within a PHP code block (between curly braces)

Code:
<table>
&lt;?php foreach ($json->departures->result as $departure): //colon here instead of brace ?&gt;
    <tr>
        <td>&lt;?php echo $departure['flight_id'];?&gt;</td>
        <td>&lt;?php echo $departure['airlines_name'];?&gt;</td>
        <td><img src="&lt;?php echo $departure['image'];?&gt;"/></td>
    </tr>
&lt;?php endforeach; //endforeach statement here instead of end curly brace?&gt;
</table>

http://ellislab.com/codeigniter/user-gui...e_php.html


Messages In This Thread
JSON Decode Array - by El Forum - 12-25-2012, 11:43 AM
JSON Decode Array - by El Forum - 12-26-2012, 09:01 AM
JSON Decode Array - by El Forum - 12-26-2012, 10:24 AM
JSON Decode Array - by El Forum - 12-26-2012, 11:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB