When I replace an HTML emoji with its code and try to save the page: $text = preg_replace("/ /", "😃", $text); I get a message saying something like "Some elements may not be saved properly since you have encoding windows-1251 elements, etc.". If I go on and save the page, the code after the preg_replace gets cut off and the emoji looks like some crazy code. Is there a way to save a php page with HTML emojis in it?
there is one great thing I like about internet - you can find everything here! Okay, so I can see that there is a topic about it in stackoverflow, maybe it will help you. Here you go: https://stackoverflow.com/questions/34621541/why-dont-emojis-render-in-my-html-and-or-php
The declaration is correct in my case (<meta charset="utf-8">). I am beginning to wonder if what I am trying to do is even possible.
You know what's weird? When I put something like: $emoji_help = "৳¥₹₮₱₩฿₫₡₣₦₽₪"; Code (markup): right above this $text = preg_replace("/ /", "😃", $text); and other emoji preg_replaces, it saves the page just fine. Not sure what's behind that. I will try what you suggested since it's the right way to do it, I am sure.
How can anyone answer this question? It's not clear what the original poster is asking for or trying to do... Are you trying to save a Web Page outputted from a PHP script or an actual PHP script? Is the Internet Browser giving you that warning message or is your editor? Are you concern with OTHERS being able to correctly save the page or just yourself? Let's start there..