I am not attempting to have the correct codes just thrown at me but I really need to understand why I’m having the problems I am. I have several books, but they are all the same in that they tell you what functions are but not really how to use them in an applied way.
There are essentially three things wrong with my code. As you can see I am including another php file to pull all the information from ($petspa).
I have the While with the format I need. But I am unable to insert a proper table. Also I want to take each breed and do a summary of total revenue from that breed as attempted once in the For (I should just be able to repeat that For While for each breed.) Finally I need a simple array to display the single breed that brings in the most revenue, showing only its breed type and total revenue.
The while works, but I can’t do a simple table for it to appear organized.
The for does not work at all.
And I have no idea how to pull out an array for the single breed and total profits
<?php
Include ‘petspainfo.php’
$breed = rtrim(strtok($pet_spa, " \n"));
$appointment = rtrim(strtok(" \n"));
$day = rtrim(strtok(" \n"));
$time = rtrim(strtok(" \n"));
$charge = rtrim(strtok(" \n"));
printf ("%9s\n", "Breed App. Day Time Charge");
while($breed){
echo $breed, " ";
echo $appointment, " ";
echo $day, " ";
echo $time, " ";
echo "\$" . number_format ($charge,2);
$breed = rtrim(strtok(" \n"));
echo date('M',mktime(12,0,0,$appointment,1,2009)) . " ";
$day = rtrim(strtok(" \n"));
$time = rtrim(strtok(" \n"));
$charge = rtrim(strtok(" \n"));
}
for ($breed = Lab){
echo $breed;
$charge = $charge + $charge;
echo $charge
}
?>