Skip to content
Advertisement

Get the first element of my array $_POST[‘tableFields’]

I’m trying to get the first element of my asociative array $_POST['tableFields'].

JavaScript

I tryied using reset() method but doesn’t show anything.

JavaScript

Advertisement

Answer

It is JSON format so its a string value. You must do print_r(json_decode($_POST['tableFields'],1)[0]); or reset(json_decode($_POST['tableFields'],1));

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement