December 23, 2015

PHP - When submit form string replace space to Â



Today I working on a PHP project and I face one spacing problem like when I submit form with CKeditor then all space   replace with  undefined character,

So I find a best solution for that and share it here.

Fist please include following meta line in <head> tag:

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

And second thing is when you submit CKeditor field then used 'utf8_decode' function, see in below example:

$message=utf8_decode($_REQUEST['message']);

Here 'message' is your field name.

Enjoy!

2 comments:

  1. Your blog was absolutely fantastic! Great deal of great information and this can be useful some or maybe the other way. Keep updating your blog, anticipating to get more detailed contents

    Web Development in Ludhiana

    ReplyDelete
    Replies
    1. @JaydenFox

      Thank you very much and If you want any help from me then please comment me here.

      Delete

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...