I have an array that I want to split and display. I have this so far: $table_data = "7.5;6.5;6.0;7.5;8.5;10.5"; print_r (explode(";",$table_data)); PHP: Which will output this: Array ( [0] => 7.5 [1] => 6.5 [2] => 6.0 [3] => 7.5 [4] => 8.5 [5] => 10.5 ) Code (markup): But what I want to do is to be able to take the value of the first array and just display the contents - so in this case I want to be able to print the information in [0] to one place, the information from [1] to another and so on. How do I display each section of the array on it's own? Thanks in advance.
You can print the 1st element of $Array as echo $Array[0]; and so on. Is that what you need? Thanks, e = mc²
Yeh - I tried this but then it comes out wrong. Where I wan't the first array it displays '7' The second array displays '.' the third array displays '5' The fourth array displays ';' I need to tell it that the seperator is a semi-colon... but how? Thanks
Ah - I've worked it out now! Thanks, you pointed me in the right direction... It's as follows: $table_data = "7.5;6.5;6.0;7.5;8.5;10.5"; $table_data_exploded = (explode(";",$table_data)); PHP: and then echo $table_data_exploded[0]; echo $table_data_exploded[1]; echo $table_data_exploded[2]; etc PHP: Brilliant