I am trying to load data from a variable that contains information and then place them into a string to use on web page using only the space as a divider. I know I have to loop through but I cannot. Shall I perform this in PHP before or use JS to do this? Also is it possible to load up to say 3 at a time? Is it possible to do this? The string looks like this :-
$areas = "London Birmingham Leeds Glasgow Bradford Liverpool Edinburgh etc etc"
and this is how I would like to place the data :-
<h3 class="areas">London</h3>
<h3 class="areas">Birmingham</h3>
<h3 class="areas">Leeds</h3>
or something like :-
<h3 class="areas">London Birmingham, Leeds</h3>
Thanks in advance for any advice.