$paymentModules = getPaymentModules(); // retrieve list of payment modules foreach ($paymentModules as $module) { echo $module . "
"; // display the name of each payment module }
$paymentModules = getPaymentModules(); // retrieve list of payment modules if (in_array("PayPal", $paymentModules)) { // display PayPal checkout button echo ""; }In this example, the getPaymentModules function is called to retrieve a list of installed payment modules. The code then checks if PayPal is one of the available payment options, and if so, displays a checkout button for PayPal. The getPaymentModules module is not a standard part of the PHP language, but is likely part of an e-commerce library or package.