I have got a problem with the variable outside the loops. I want to store the variable of $programme_title
from the foreach $time_arr
loop shown below, and get back a short list of strings like this:
Paid Programming The Mentalist - Black HeartsAnthony Bourdain Parts Unknown - Russia
NFL Live StosselBad Dog! - Bad to the BoneHouse - Son of Coma GuyCutlery Corner Wild
The Real Housewives of Atlanta - Secrets RevealedThe Real Housewives of Atlanta - Secrets Revealed
The Real Housewives of Atlanta - Secrets Revealed The Real Housewives of Atlanta - Secrets Revealed
The Real Housewives of Atlanta - Secrets Revealed The Real Housewives of Atlanta - Secrets Revealed
The Real Housewives of Atlanta - Secrets RevealedThe Real Housewives of Atlanta - Secrets Revealed
When I used this code:
foreach($programme_arr as $programme)
{
$programme1 = $programme->item(0)->nodeValue;
$programme_title = $programme1;
}
echo $programme_title;
Or try this:
foreach($programme_arr as $programme)
{
$programme1 = $programme->item(0)->nodeValue;
$programme_title = $programme1;
}
foreach($time_arr as $time)
{
echo $programme_title;
}
It doesn't work. So, I tried this code:
foreach($programme_arr as $programme)
{
$programme1 = $programme->item(0)->nodeValue;
$programme_title = $programme1;
echo $programme_title;
}
And got back this large list of string:
Step Up 3The 700 Club The Fresh Prince of Bel-Air - Not With My Cousin You Don't
The Fresh Prince of Bel-Air - Viva Lost Wages The Fresh Prince of Bel-Air - There's the Rub
The Fresh Prince of Bel-Air - There's the RubSummer Sexy With T25!Dr. Ordon's Secret!
The 700 ClubAirbrushed BeautySleep Better!Joseph PrinceLife Today With James Robison - SMF Special 1
Joyce Meyer: Enjoying Everyday LifeShaun T's Focus T25That '70s Show - The Velvet Rope
That '70s Show - Laurie and the ProfessorThat '70s Show - HalloweenThat '70s Show - Van Stock
and so on...
Can you please tell me how I can store the variable of $programme_title
in the foreach $time_arr
to allow me to print the list of strings like on above?