Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help on writing a function \"validate\" that accepts 1 parameter. The one

ID: 3539268 • Letter: I

Question

I need help on writing a function "validate" that accepts 1 parameter. The one parameter is the value of a customerID. validate() must call customerLookup() and return what customerLookup() returns.


I need to "call" customerLookup and pass the parameter to it and reutrn what customerLookup returns.


Here is what I have so far as a test function, but it just returns "2" and "Not Found."
Im really confused on how to pass the function to customerLookup and return what it returns. Any Help please?


<?php


function customerLookup() {


if ($customerId = 1) {


return "alex";


} else {


echo "NOT FOUND!";


};



};


function validate ($p1) {


customerLookup($p1);


$customerID = $p1;


return $customerID;


echo $customerID;





};


echo validate(2);


?>

Explanation / Answer

No answer text found in this record.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote