1.

Solve : Somethings wrong in my php function??

Answer»

The idea:

I call "GetNumberOfPages(Instance $Number of items)"
and it returns the number of items I sent it.

function GetNumOfPages($rows) {
$max = 5;
$pgs = $rows;
$ps = 1;
$a = 0;
echo "";
while($pgs > $max) {
$a++;
echo "";
if($a == $max) {
$ps++;
}
$pgs = $pgs -1;
}
return $ps;
}I have no idea what you're trying to do here.  What's all the stuff supposed to be doing?  Is that within > tags?The   is for COMMENTS in PHP. Nothing will be shown because everything in teh output is a comment. USE echo"$ps"; or echo"$a"; without the comment code. Quote

The <!-- comment here--->  is for comments in PHP.
No, they are HTML comments.

/*
This is a block
of omments
*/

# One line comment
// One line comment

Those are PHP comments. Quote from: kpac on AUGUST 01, 2009, 04:24:38 AM
No, they are HTML comments.

/*
This is a block
of omments
*/

# One line comment
// One line comment

Those are PHP comments.
But SINCE he's using echo those are comments and won't be shown.The "while" echoed in the middle of the HTML comment is what's throwing me...


Discussion

No Comment Found