How to convert special characters to unicode in php?

Satyendra Chauhan
Satyendra Chauhan

Posted On: Feb 27, 2020

 

There is function json_encode() which is converted special characters to Unicode in PHP.

Example:-

$stringa = " I am good at smiling";
print_r(json_encode($stringa));

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    PHP String Interview Questions

    What is String in PHP?

    The String is a collection or set of characters in sequence in PHP. The String in PHP is used to save and manipulate like an update, delete and read the data....

    PHP String Interview Questions

    How to cast a php string to integer?

    The int or integer used for a variable into an integer in PHP....

    PHP String Interview Questions

    How to perform string concatenation in PHP?

    The string concatenation means two strings connect together. The dot ( . ) sign used in PHP to combine two string. Example:- <?php $stringa = " creative "; $stringb = "writing "; echo $stringa ...