Updated on 2025-12-10 GMT+08:00
PHP Function Template
The following is a sample code template of a PHP function:
<?php
/*function initializer($context) {
$output = 'hello Initializer';
return $output;
}*/
function handler($event, $context) {
$output = array(
"statusCode" => 200,
"headers" => array(
"Content-Type" => "application/json",
),
"isBase64Encoded" => false,
"body" => json_encode($event),
);
return $output;
}
?>
When you create an empty PHP event function on the FunctionGraph console, the preceding sample code is deployed by default.
Parent topic: PHP
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot