$nesAry=array();
$nesAry["name"]="abc";
$nesAry["email"]="[email protected]";
$nesAry1=array();
$nesAry1["name"]="abc1";
$nesAry1["email"]="[email protected]";
$nesAry2=array();
$nesAry2["name"]="abc2";
$nesAry2["email"]="[email protected]";
$responseAry = array();
$responseAry[0]=$nesAry;
$responseAry[1]=$nesAry1;
$responseAry[2]=$nesAry2;
echo json_encode($responseAry); // here output like this => [{"name":"abc","email":"[email protected]"},{"name":"abc1","email":"[email protected]"},{"name":"abc2","email":"[email protected]"}]
unset($responseAry[1]);
echo "------------removed 1--------";
echo json_encode($responseAry); // but here output like this => {"0":{"name":"abc","email":"[email protected]"},"2":{"name":"abc2","email":"[email protected]"}}
I want Out put Like this after removing an element \n [{"name":"abc","email":"[email protected]"},{"name":"abc2","email":"[email protected]"}]
Please Help me