- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
For this, at first use preg_split() and set the function with this −
After setting like above, the empty delimiter issue will get fixed, since we added '//u' above.
The PHP code is as follows
<!DOCTYPE html> <html> <body> <?php $stringValues=""; $result= preg_split('//u', $stringValues,-1, PREG_SPLIT_NO_EMPTY); print_r($result); echo "<br>"; $stringValues1="John Smith"; $result1= preg_split('//u', $stringValues1,-1, PREG_SPLIT_NO_EMPTY); print_r($result1); ?> </body> </html>
This will produce the following output −
Array ( ) Array (  => J  => o  => h  => n  =>  => S  => m  => i  => t  => h )
- How to represent Unicode strings as UTF-8 encoded strings using Tensorflow and Python?
- How can Tensorflow text be used to split the UTF-8 strings in Python?
- How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters in java?
- How to read and write unicode (UTF-8) files in Python?
- UTF-8 Validation in C++
- Convert Unicode to UTF-8 in Java
- Convert UTF-8 to Unicode in Java
- How to convert an MySQL database characterset and collation to UTF-8?
- How to convert wrongly encoded data to UTF-8 in MySQL?
- How to convert byte literals to python strings?
- Convert String to UTF-8 bytes in Java
- Convert ASCII TO UTF-8 Encoding in PHP?