Looking on how to remove array
My PHP Code :
<?php
header('Access-Control-Allow-Origin: *');
include('./db_connect.php');
if( isset($_GET["id"])) {
$sql = "SELECT * FROM userstatus WHERE user_statusID = '".$_GET["id"]."'";
}
$result = $conn->query($sql);
$arr_data = array();
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
array_push($arr_data,$row);
}
}
else {
$arr_data = null;
}
echo json_encode($arr_data);
$conn->close();
and result is :
[{"user_statusID":"1","status":"Admin"}]
i need to remove
"["{"user_statusID":"1","status":"Admin"}"]"
When Single row result is :
how I can do that