Jump to content

[SOLVED] str_replace help


richiec

Recommended Posts

http://www.dks-gfx.com/profileparse.php

 

if you go there and in the text box put devilknightsparda then click go that will parse the "skill" information from the profile devilknightsparda. What i would like it to do is replace the text which it finds for each skill with an image of that skill.

 

ive spent awhile working on it and got nowhere.. i have tried str_replace because i was told that would be the best thing to use to replace the text on there.. but using that just gives me errors..

 

right now this is how it gets the information..

 


list($before, $after) = split("/images/skill_13.gif", $file);
list($looting) = split("You steal", $after);

list($before, $after) = split("/images/skill_46.gif", $file);
list($wall) = split("Casting shield", $after);

list($before, $after) = split("/images/skill_4.gif", $file);
list($stealth) = split("Increases targets HP", $after);

list($before, $after) = split("/images/skill_28.gif", $file);
list($fort) = split("You receive +", $after);

list($before, $after) = split("/images/skill_15.gif", $file);
list($cop) = split("Reduces your damage taken", $after);

list($before, $after) = split("/images/skill_7.gif", $file);
list($bag) = split("Makes all your supplies invulnerable", $after);

list($before, $after) = split("/images/skill_50.gif", $file);
list($bfa) = split("You receive +", $after);

list($before, $after) = split("/images/skill_3.gif", $file);
list($emp) = split("Increases targets ATK", $after);

list($before, $after) = split("/images/skill_9.gif", $file);
list($lust) = split("Target receives +", $after);

list($before, $after) = split("/images/skill_2952.gif", $file);
list($np) = split("Reward buff for", $after);

list($before, $after) = split("/images/pot5.jpg", $file);
list($sammy) = split("</b><br>", $after);

list($before, $after) = split("/images/pot21.jpg", $file);
list($potfort) = split("</b><br>", $after);



echo "<table border=\"1\">
<tr>
    <td width=\"188\"><b>$cid</b></td>
    <td width=\"1000\">$text $looting $wall $stealth $fort $cop $bag $bfa $emp $lust $np $sammy $potfort</td>

  </tr>

 

(if there is a better way to get each part of that information for each skill then feel free to help there also)

 

i dont want the site to display any text other than cid (the name placed into the text box) only the image for each skill.

 

any ideas/examples of how i can do that?

 

Thanks

 

Rich.

Link to comment
https://forums.phpfreaks.com/topic/60252-solved-str_replace-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.