function ref($url) { $this->incr($pc,$fp,$nc); $this->write($nc,$cfile); }
function incr($pc,$fp,&$nc) { if($pc != "") $nc = intval($pc)+1; else fputs($fp,1); return $nc; } Additionally, why do I have to pass the nc variable to function incr() as reference? It did not work just do return $nc.
See http://www.php.net/manual/en/language.variables.scope.php
If these functions are in a class, you could try and make $nc a variable in the class and refer to it as $this->nc inside the class.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php