PDA

Click to See Complete Forum and Search --> : Removing the first two characters of a string and adding two new ones too the end..


Cheeko
Aug 8th, 2001, 02:49 AM
Hi,

I'm running a racing game. I gets horses names and values from a mySql database in php and then adds then into this java script eqution. Now, these horses have 'form' of their past five races. So what I want to do is update it after each time the race is run. So, I need to do a if then else clause in js checking if the winner in js is equal to the horses name if php..


if (arrayWinner[0] == <? echo $horse1_info[name]; ?>)
{
<?
// Do the form editing here..
?>
}


And so on.. You understand?

the form itself is 5 numbers seperated by '-'

like: 1-3-2-4-1 so maybe an explode function?

Cheers