Arrays and Strings in PHP

Started by G_G, January 15, 2010, 07:02:23 pm

Previous topic - Next topic

G_G

Okay so I was dinking around with PHP and did some googling. I found this.
$string = "pizza1 pizza2 pizza3";
$array = explode(" ", $string);
echo $array[0];
echo $array[1];


Which works. However what I need to do is get an array from the RMX-OS Database. Which looks something like this.
[0,50,Array,Hash,Hash,Hash]

This is Game_Party : Gold - Steps - Actors - Items - Weapons - Armor

Now what I need is like a string split function and a string replace function. If they exist then could someone post them please? Because then I'd be able to perfectly create a character info page.

Also how do we go through every part of an array? Is it as easy to do in Ruby?
Pretty much I want to do this.
array = [1, 2, 3, 4, 5]
for i in array
  print i
end