1

Please find my code sample below where I take the POST input data and convert into JSON after which I check if the data has the required info or not. I'm using Visual Studio with PHP Intelephense. It provides the error mentioned "Expected type 'object'. Found 'string|false'.intelephense(1006)". As I am new to PHP, can someone assist why this is an issue?

$data = json_encode(file_get_contents("php://input"));

if(
   !empty($data->symbol) &&
   !empty($data->trading_date) &&
   !empty($data->series))
{ // do something
}
AGX301
  • 11
  • 3

0 Answers0