Is it possible to read these strings (was converted to strings from json format) into php arrays?
jQuery:
$.ajax({
type: 'GET',
url: 'index.php?task=search&wtd=ul',
data: $('#fupdate').serialize()+'&derulo='+$('#getdbresult').val(),
beforeSend: function(){
$('.the-modal').html('Updating...');
},
success: function(d){
$('.the-modal').html(d);
console.log(d);
}
});
PHP:
var_dump(json_decode("{$_REQUEST['derulo']}", true));
VALUES:
string(379)"[{\"target_detail_id\":\"66351031\",\"first_name\":\"Dorothy\",\"last_name\":\"Smith\",\"company\":\"Active Money Now\",\"sic_code\":\"\",\"position\":\"\",\"target\":\"1300572544\",\"website\":\"\",\"email\":\"[email protected]\",\"email_status\":\"\",\"country\":\"Australia\",\"city\":\"Broken Hill\",\"postal_code\":\"2880\",\"address\":\"Po Box 41\",\"note\":\"\"}]"
RESULT:
NULL
I tried using json_decode but nothing appears.
Also looked at using implode to separate strings accordingly.
But is there any other way to this?
EDIT:
It works with: $object = (json_decode(stripslashes($_REQUEST['derulo'])));
json_decode('...json...', true);?