I have a object recipe that has multiple params
This works, I passed the object thru ajax to my php
$.post('addRecipe.php', recipe, function () {});
And this works, php getting the params
function getParam($param) {
if (!empty($_POST[$param])) {
return $_POST[$param];
}
return 'UNKNOWN';
}
$name = getParam('name');
$phone = getParam('phone');
Now I want to pass 2 objects the recipe that has multiple params and recipeID that has 1 param
$.post('editRecipe.php', {recipe: recipe, recipeID: recipeID}, function (){});
how can i get it with php?