In this project I am sifting through non formatted HTML code and looking for a specific value, below is a section of code from a paragraph deconstruction function. I am using preg_replace to get rid of any unneeded html code until I end up with a small array of variables delimited by the html
tag. Below is the section of logic I am having a problem with. For some reason I am receiving an un-defined offset 5 error when attempting to print the 5th position of the array $pieces. I am using the explode function to create the array and have included the chunk of html code I am running explode on.
$new_broken_var = preg_replace($para_search, $para_replace, $para_subject);
$pieces = explode("<br>", $new_broken_var);
echo $pieces[5];
//upon echoing $new_broke_var I received the below html as it's value
//<font face="Arial" size="2">For 06/01/13 to 06/30/13<br>
//Report Generated: Thursday, July 11, 2013<br>Unit: 204 <br>
//Driver:<br>Owner:<br>Number of Trips: 27<br>Fuel Type: Diesel</font>
//creates an array using <br> as it's delimiter on the commented code above
//the variable we want is in position number 5 within the array. and confirmed via print_f($pieces);