最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - Wordpress not encoding "é"

programmeradmin0浏览0评论

i have some problem encoding. I m making a plugin and in my table i have insert some words with the "é' but the result of display is �.

My tables are utf8_general_ci, in wp config the encoding is utf8. I tried also to comment define('DB_CHARSET', 'utf8mb4'); define( 'DB_COLLATE', '' );

But nothing is working. How can i do?

This is the request

global $wpdb;   
$resu = $wpdb->get_results('
SELECT '.$wpdb->prefix.'mic_combinaisons.id, '.$wpdb->prefix.'mic_keyword.keyword, '.$wpdb->prefix.'mic_secteurs.libelle
FROM '.$wpdb->prefix.'mic_combinaisons
INNER JOIN '.$wpdb->prefix.'mic_keyword ON '.$wpdb->prefix.'mic_keyword.id = '.$wpdb->prefix.'mic_combinaisons.id_keyword
INNER JOIN '.$wpdb->prefix.'mic_secteurs ON '.$wpdb->prefix.'mic_secteurs.id_secteurs = '.$wpdb->prefix.'mic_combinaisons.id_secteur', OBJECT 
);

and i try to display like

foreach ( $resu as $res ) {
    $id = $res->id;
    $keyword = strtolower(str_replace(" ","-",$res->keyword));
    $secteur = strtolower(str_replace(" ","-",$res->libelle));
    $mic_slug = normalize($keyword) ."-".normalize($secteur)."-k".$id;
    echo($mic_slug);
发布评论

评论列表(0)

  1. 暂无评论