mysqli_set_charset($conn, "utf8");
$stmt= $conn->prepare("SELECT id, title FROM ****************");
$stmt->execute();
$stmt->bind_result($id,$title);
$arr = array();
while($stmt->fetch()){
$study= (object)array();
$study->id = $id;
$study->title=$title;
array_push($arr,$study);
}
echo json_encode($arr);
Here is the result of the above code
Questions
How can I achieve full unicode support in my json data?
How can I remove the html tags while sending the data to mobile apps?
What I am trying to accomplish is: This is a web API
for my Android app in react native, I am having problem with unicode support.
The main thing is when I paste the code on google search then it shows converted text, which means I am missing something here.
And when I use print_r[]
to print the array the result is fine?
जिसस क्राइष्टको जन्म कहीले भएको हो ?
– Ujjwal Nepal Nov 14 '16 at 07:01