21 lines
455 B
PHP
21 lines
455 B
PHP
<?php
|
|
|
|
class ReportApi
|
|
{
|
|
public $apiName = 'report';
|
|
const REPORTS = array(
|
|
"weeklySpending" => 1
|
|
);
|
|
|
|
public function test($code) {
|
|
$chck = self::REPORTS;
|
|
error_log('-----');
|
|
error_log($code=="weeklySpending"?"TRUE":"FALSE");
|
|
error_log(array_key_exists(trim($code),$chck)?"TRUE":"FALSE");
|
|
error_log($chck["weeklySpending"]==1?"TRUE":"FALSE");
|
|
}
|
|
}
|
|
|
|
var_dump(ReportApi::test("weeklySpending"));
|
|
|