Page 1 of 1
Help with some code...
Posted: Fri Jan 08, 2010 3:37 pm
by parino_esquilado
Code: Select all
<?php
$string = "4,3+4,3+4,3+4,d/b+3+4,u/f+3+4";
$newstring = str_replace("2", '<img src ="http://www.hscripts.com/freeimages/icons/symbols/shapes/triangle/triangle-image8.gif">', $string );
$newstring2 = str_replace("4", '<img src ="http://www.crazymonkeygames.com/guide/Stackz/Images/Stackz_Small_Circle.jpg">', $newstring );
$newstring3 = str_replace("2", '<img src ="http://www.hscripts.com/freeimages/icons/symbols/shapes/triangle/triangle-image8.gif">', $newstring2 );
echo $newstring2;
?>
Well this is something I am trying to create. I am making a move list for a ps3 game. Look here:
http://www.tekkenzaibatsu.com/tekken6/m ... hp?id=eddy
What this is is me trying to replicate this, however changing the numbers to graphics (as demonstrated above in my code).
As you can see (from the website) numbers such as '4,3+4,3+4,3+4,d/b+3+4,u/f+3+4'
Check out the legend on the website and please help, there are so many things I need to include to make this faster.
Re: Help with some code...
Posted: Fri Jan 08, 2010 3:52 pm
by manohoo
I don't quite understand what you want. Ask a simple question, such as:
$string = "4,3+4,3+4,3+4,d/b+3+4,u/f+3+4";
I want to convert string to:
$newstring = "whatever";
Replace "whatever" with what you want. Explain your reasoning as well as you can.
Re: Help with some code...
Posted: Fri Jan 08, 2010 3:55 pm
by Bigun
Your $newstring3 has a single-quote then a double-quote. It needs to be one or the other.
Re: Help with some code...
Posted: Fri Jan 08, 2010 4:00 pm
by parino_esquilado
Bigun wrote:Your $newstring3 has a single-quote then a double-quote. It needs to be one or the other.
where?
i have to enclose double quotes with single quotes otherwise the html doesn't function.