I want to be happy, just happy and that's what I can't be today. Life sucks sometimes.
Printable View
I want to be happy, just happy and that's what I can't be today. Life sucks sometimes.
I wish dear pensy would stop feeling Pensive..:bawling:
maybe you could look at the very funny lol thread or the joke thread.
What I'm thinking right now:
"I wanna take a bath."
Then I wouldn't be Pensive. :p
But hey, I have a better thought for now! Pensive people can be optimistic. :D
Life is like an ice-cream, enjoy it before it melts. Heard it from somewhere, don't necessarily agree with it, but it is something nice to have a belief in. :)
I know exactly what ya mean..:)
You sound like you're feeling better now!
Glad to hear it!:)
should get back to trying to get this stupid decsion function to work I mean can anyone see anything wrong with this function?
I cant it infuriating I need the php angels to come and save me!Quote:
Originally Posted by nights stupid programme
hey they are in order....arent they oh no have I got it all wrong is that why its not working?:eek2:
$catstat=explode(';',$catin[$i])//thisseperates them
The above statement doesnt show '$catstat' as an array
print "$catstat[0]is $catstat[1] years old";//what to do if it works
In this statement you are trying to use '$catstat' as an array using [0] and [1]
I think here is the problem, the variable '$catstat' has two different usage - one as a simple variable and in the IF loop as an array.
If you make the variable type the same this program might work.
no thats part of the program youll have to excuse the rammbling comments to myself butits in an array but whenever I try to run it it starts objecting to the line with if($i==5){Quote:
<?php
/*find out why the next section of code doesnt work...that is WHY oh why is it printing regardless*/
//$cats='13';
//if($cats>=10){
//print'cat lady!!!';
//}
//yay its working!! next task get file!!
$catin=file('catsparty.txt');
print"$catin[5]<br>";
print"$catin[3]<br>";
print"$catin[7]<br>";
/* combine a loop with an if/elseif statement so get a for loop going making it explode then get it to if the exploded answer to print out certain results.*/
for($i=0;$i<25;$i++){ //this makes the loop go round should calculat $i asn mber of lines!!
$catstat=explode(';',$catin[$i])//thisseperates them
if($i==5){
print "$catstat[0]is $catstat[1] years old";//what to do if it works
}
elseif($i==3){
print "$catstat[0]is $catstat[1] years old";
}
elseif($i==7){
print "$catstat[0]is $catstat[1] years old";
}
}
?>
Another thing I would like to add is that every IF has to have an ELSE.
In the construct, ONE Else is missing.
if($i==5)
elseif($i==3)
elseif($i==7)
ELSE This will end the loop.
Ofcourse, I dont know php, but I know C and C++ and this is how the loop works in these languages. I think the concept will be the same here as well.
EDIT -- as per php syntax you will also have to check the number of curly braces '{}' that are required. Sometimes, small errors like these will not allow the program to work, eventhough the logic is correct.
ah right thanks :D:D well back too cursing the program...
How shallow my attempts for writing must have been today, in order my writing classes' fellows to allow themselves to praise me, which they usually do when they are not afraid someone's writing is better than their
Dunno