I have a string contain emoji. I want extract emoji's from that string,i'm using below code but it doesn't what i want.
$string = "
I have a string contain emoji. I want extract emoji's from that string,i'm using below code but it doesn't what i want.
$string = "
Try looking at
preg_match_all
function.preg_match
stops looking after it finds the first match, which is why you're only ever getting the first emoji back.Taken from this answer:
So your code would become: