$action = $_POST['action'];
switch($action)
{
case 0:
$ss_echo = new StdClass();
$ss_echo->action = $action + 100; //this returns null?
$ss_echo->success = 0; //this returns 0
echo(json_encode($ss_echo));
break;
}
What am I doing wrong that is making $action + 100 null when echoed?
EDIT (SOLVED):
$ss_echo = new StdClass();
$ss_echo->action = intval($action) + 100;