Wednesday, March 7, 2012

Adding these games and descriptions to separate variables PHP.?

I'm working on putting the games and descriptions in separate variables but what ever i try dont seem to work. All this does is show all the games and descriptions on screen. Its just suppose to show 1 game but later i want it to go down the list 1 at a time and then add game to database along with a description anyone have a clue on what im talking about or how to do this.



%26lt;?php

$alist='%26lt;tr%26gt;

%26lt;td class="ta-c splitter "%26gt;

%26lt;/td%26gt;

%26lt;td class="ta-c"%26gt;

%26lt;a href="/modern-warfare-2/61-24713/"%26gt;%26lt;img src="http://media.giantbomb.com/uploads/鈥?class="w-50" style="margin-top:6px;"/%26gt;%26lt;/a%26gt;

%26lt;/td%26gt;

%26lt;td class="mgray"%26gt;

%26lt;div class="pt-5 pb-5"%26gt;

%26lt;a href="/modern-warfare-2/61-24713/" class="f-14"%26gt;Modern Warfare 2%26lt;/a%26gt;

%26lt;div class="f-11 lh-14"%26gt;Modern Warfare 2 is a high profile military first-person shooter developed by Infinity Ward. Though it takes place in the Call of Duty universe, it is a direct sequel to the universally acclaimed Call of Duty 4: Modern Warfare.%26lt;/div%26gt;

%26lt;/div%26gt;

%26lt;/td%26gt;

%26lt;td class="f-11 w-100"%26gt;

Nov. 10, 2009

%26lt;/td%26gt;

%26lt;td class="f-11 ta-c"%26gt;

%26lt;a href="/xbox-360/60-20/" class="X360"%26gt;X360%26lt;/a%26gt;,

%26lt;a href="/pc/60-94/" class="PC"%26gt;PC%26lt;/a%26gt;,

%26lt;a href="/playstation-3/60-35/" class="PS3"%26gt;PS3%26lt;/a%26gt;

%26lt;/td%26gt;

%26lt;/tr%26gt;

%26lt;tr%26gt;

%26lt;td class="ta-c splitter "%26gt;

%26lt;/td%26gt;

%26lt;td class="ta-c"%26gt;

%26lt;a href="/dragon-age-origins/61-20738/"%26gt;%26lt;im鈥?src="http://media.giantbomb.com/uploads/鈥?class="w-50" style="margin-top:6px;"/%26gt;%26lt;/a%26gt;

%26lt;/td%26gt;

%26lt;td class="mgray"%26gt;

%26lt;div class="pt-5 pb-5"%26gt;

%26lt;a href="/dragon-age-origins/61-20738/" class="f-14"%26gt;Dragon Age: Origins%26lt;/a%26gt;

%26lt;div class="f-11 lh-14"%26gt;Developed by BioWare and published by EA, Dragon Age: Origins is a multi-platform action-role-playing game featuring an extensive story, deep characters and an intricate plot. It is considered a spiritual successor to the Baldur's Gate series.%26lt;/div%26gt;

%26lt;/div%26gt;

%26lt;/td%26gt;

%26lt;td class="f-11 w-100"%26gt;

Nov. 3, 2009

%26lt;/td%26gt;

%26lt;td class="f-11 ta-c"%26gt;

%26lt;a href="/pc/60-94/" class="PC"%26gt;PC%26lt;/a%26gt;,

%26lt;a href="/xbox-360/60-20/" class="X360"%26gt;X360%26lt;/a%26gt;,

%26lt;a href="/playstation-3/60-35/" class="PS3"%26gt;PS3%26lt;/a%26gt;

%26lt;/td%26gt;

%26lt;/tr%26gt;

%26lt;tr%26gt;

%26lt;td class="ta-c splitter "%26gt;

%26lt;/td%26gt;

%26lt;td class="ta-c"%26gt;

%26lt;a href="/grand-theft-auto-episodes-from-li鈥?src="http://media.giantbomb.com/uploads/鈥?class="w-50" style="margin-top:6px;"/%26gt;%26lt;/a%26gt;

%26lt;/td%26gt;

%26lt;td class="mgray"%26gt;

%26lt;div class="pt-5 pb-5"%26gt;

%26lt;a href="/grand-theft-auto-episodes-from-li鈥?class="f-14"%26gt;Grand Theft Auto: Episodes from Liberty City%26lt;/a%26gt;

%26lt;div class="f-11 lh-14"%26gt;The Lost %26amp; Damned and The Ballad of Gay Tony are collected onto this standalone disc of Grand Theft Auto IV's post-release content.%26lt;/div%26gt;

%26lt;/div%26gt;

%26lt;/td%26gt;';

ereg('%26lt;a href="(.*)" class="f-14"%26gt;(.*)%26lt;/a%26gt;', $alist, $game);

echo $game[0];

?%26gt;Adding these games and descriptions to separate variables PHP.?
Use array_push() to add one value at a time to an array. This will create a list with all of the games. You can then pull from this list to display whatever you want.Adding these games and descriptions to separate variables PHP.?
can you show me an example of how to do that

Report Abuse

No comments:

Post a Comment