mbstring

utf8_(en|de)code removed from php7?

≯℡__Kan透↙ 提交于 2019-11-26 14:10:00
问题 I recently switched to PHP 7 on my development server, which has worked just fine - until now. Since I updated to PHP 7.0.3-10+deb.sury.org~trusty+1 (earlier today), the utf8_decode and utf8_encode functions are no longer accessible. They were, however, in previous versions of PHP7. When called, a fatal error is raised. I read that these functions are provided by the mbstring extension, which I checked with var_dump(extension_loaded('mbstring')); is loaded. How can I get the above functions

How to write file in UTF-8 format?

喜夏-厌秋 提交于 2019-11-26 11:47:22
I have bunch of files that are not in UTF-8 encoding and I'm converting a site to UTF-8 encoding. I'm using simple script for files that I want to save in utf-8, but the files are saved in old encoding: header('Content-type: text/html; charset=utf-8'); mb_internal_encoding('UTF-8'); $fpath="folder"; $d=dir($fpath); while (False !== ($a = $d->read())) { if ($a != '.' and $a != '..') { $npath=$fpath.'/'.$a; $data=file_get_contents($npath); file_put_contents('tempfolder/'.$a, $data); } } How can I save files in utf-8 encoding? file_get_contents / file_put_contents will not magically convert

Fatal error: Call to undefined function mb_detect_encoding()

浪子不回头ぞ 提交于 2019-11-26 06:45:21
问题 I receive this error after trying to set up LAMP by following this tutorial, and I find myself receiving the above error after trying to set up phpmyadmin. Fatal error: Call to undefined function mb_detect_encoding() in C:\\WebServer\\Apache\\htdocs\\phpmyadmin\\libraries\\php-gettext\\gettext.inc on line 177 I followed the advice over here: PHP Fatal error when trying to access phpmyadmin mb_detect_encoding, and made those changes. When I run phpinfo() , I see that support for MySQL and mb

How to install PHP mbstring on CentOS 6.2

老子叫甜甜 提交于 2019-11-26 04:44:21
问题 How do I install mbstring with PHP on CentOS 6.2 I\'ve tried: $ sudo yum install php-mbstring Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * base: mirror.net.cen.ct.gov * extras: centos.aol.com * updates: mirrors.seas.harvard.edu Setting up Install Process No package php-mbstring available. Error: Nothing to do But no packages were found? 回答1: do the following: sudo nano /etc/yum.repos.d/CentOS-Base.repo under the section updates , comment out the

How to write file in UTF-8 format?

自作多情 提交于 2019-11-26 02:35:50
问题 I have bunch of files that are not in UTF-8 encoding and I\'m converting a site to UTF-8 encoding. I\'m using simple script for files that I want to save in utf-8, but the files are saved in old encoding: header(\'Content-type: text/html; charset=utf-8\'); mb_internal_encoding(\'UTF-8\'); $fpath=\"folder\"; $d=dir($fpath); while (False !== ($a = $d->read())) { if ($a != \'.\' and $a != \'..\') { $npath=$fpath.\'/\'.$a; $data=file_get_contents($npath); file_put_contents(\'tempfolder/\'.$a,