Assuming this is the only JSON you have, let's store it in $json for the sake of the example:
$json = '[{"name":"firstname","value":"wwwwww"},{"name":"lastname","value":"w"},{"name":"age","value":"99"},{"name":"sex","value":"male"}]';
First, json_decode your JSON so we can use PHP to process it:
$data = json_decode($json);
Then create an array to store your processed data an iterate through it, retrieving and assigned values to the array to achieve your desire structure:
$processed_data = array();
foreach($data as $data_field) {
$processed_data[$data_field->name] = $data_field->value;
}
Here's a var_dump of the resulting array:
array(4) {
["firstname"]=>
string(6) "wwwwww"
["lastname"]=>
string(1) "w"
["age"]=>
string(2) "99"
["sex"]=>
string(4) "male"
}