I'm currently having trouble printing some simple test statements within my for loop.
<?php
include('../connstr.inc');
$email=$_REQUEST["email"];
$datafile=$_REQUEST["datafile"];
$email_safe=preg_replace("/[^a-zA-Z]/","_",$email);
$path="../uploaded_data";
$xml = simplexml_load_file("{$path}/{$email_safe}/{$datafile}.xml");
// Retreive data details for specified activity
$lapcount = $xml->Activities->Activity->Lap->count();
echo "LapCount: " . $lapcount;
$totalTime = array(); $distance = array(); $maxSpeed = array();
$calories = array(); $intensity = array(); $trigMethod = array();
echo 'Test1';
// Collect details for each lap
for($x = 0; $x < $lapCount; $x++) {
echo 'Test2';
// Find how many trackpoints exist for specified lap
$trackPointCount = $xml->Activities->Activity->Lap[$x]->Track->Trackpoint->count();
echo 'Test3';
echo "<br /> Lap {$x} TrackP Count: " . $trackPointCount;
echo 'Test4';
}
When I run it, only 'Test1' and the 'lapCount' gets printed. Anything within the for loop doesn't run. No errors are being returned either. $x will definitely be less then $lapCount as this is just 3. I fail to see the (most likely) stupid mistake I've made even after looking over it many times.