How do I fetch words separated with space in database column differently to html table?
e.g Chelsea Vs Arsenal is stored in a column in database. I wold like to fetch those words differently in a html table with three columns showing
column 1: Chelsea, Column 2: Vs, Column 3: Arsenal
You would split the output into an array.
$str = "This is my string";
$ar = explode(' ', $str);
print_r($ar);
Outputs
Array
(
[0] => This
[1] => is
[2] => my
[3] => string
)
I smell a bad DB design. I assume those or teams that have played against each other. The data should not be stored the way you are doing it if so. Fix the database instead of creating a hack.