Help!!!

90 Pandaren Mage
14005
I can't figure out for the life of me how to pull the race icons from the http://us.media.blizzard.com/wow/icons/18/

here is a snip of the code

//Character Arrays
foreach($decode['members'] as $p) {
$mrank = $p['rank'];
$mname = $p['character']['name'];
$mclass = $p['character']['class'];
$mrace = $p['character']['race'];
$mlevel = $p['character']['level'];
$mgender = $p['character']['gender'];
$mtalents = $p['character']['talents'];
$mthumbnail = $p['character']['thumbnail'];
$machievements = $p['character']['achievementPoints'];
//Table of Guild Members
echo " <tbody class='WoWRosterBody'>
<tr class='WoWRosterRow'>
<td class='WoWRosterRace'><img style=\"padding-left: 0px;\" src='http://us.media.blizzard.com/wow/icons/18/race_$mrace_$mgender.jpg'></td>


Basically when the page loads it pulls it like this

http://us.media.blizzard.com/wow/icons/18/race_0.jpg

What am i doing wrong to pull the image file?
Reply Quote
Try changing your echo to this.

echo " <tbody class='WoWRosterBody'>
<tr class='WoWRosterRow'>
<td class='WoWRosterRace'><img style=\"padding-left: 0px;\" src='http://us.media.blizzard.com/wow/icons/18/race_".$mrace."_".$mgender.".jpg'></td>";


There may be a better way of including a variable in a string. I'm fairly new at this.
Edited by Ankzu on 7/18/2012 12:32 PM PDT
Reply Quote
90 Pandaren Mage
14005
thanks, that worked now all I have to do is try and figure out how to use cache in php and sort the roster so it doesn't show all the people in the guild :).
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]