如何在php中编码为JSON对象?
Pofile.php
<?php
include 'db.php';
$check_json = file_get_contents('php://input');
$obj1=json_decode($check_json);
$id= $_GET['uuid'];
$prep= $mysqli->prepare("select name,contact,location,bloodgp from signup where uuid= ?");
$prep->bind_param("s",$id);
$prep->execute();
$result= $prep->get_result();
$obj= json_encode($result);
?>
我想将结果编码为json对象。这是正确的吗?我如何传递这个编码对象?