Friday, 15 February 2013

php does not let me override default parameter -



php does not let me override default parameter -

i can't seem php take dynamic values parameters when have default specified. i've read here default value needs @ end of function, i've done.

$isbilling = true; function retrieve_address($dbh, $customer_id, $isbilling=false){ echo $isbilling; //false }

what doing wrong here?

you have set default value $isbilling false, , aren't passing $isbilling parameter when phone call (i'm assuming, since didn't post part).

try this:

$isbilling = true; function retrieve_address($dbh, $customer_id, $isbilling=false){ echo $isbilling; //false } retrieve_address($dbh, $customer_id, $isbilling);

php

No comments:

Post a Comment