Tag Archives: utf-8

php vis jusqu'à utf-8 charachters de base de données mysql en utilisant mysqli

I have some chinese characters (g. 中文(简体)) stored in a mysql database with content type utf8_bin.
I am pulling from the database with this code:

if($stmt = $mysqli->prepare("SELECT c_color FROM colors")){
   $stmt->execute();
   $stmt->bind_result($ccolor);
   $stmt->store_result();
   if($stmt->fetch()){
       //$ccolor is filled with 

Continuer la lecture

Tagged , , , , | Laisser un commentaire

php caractères chinois d'affichage SET NAMES 'utf8' ne fonctionne pas

I’m trying to work with a database that I got but I can’t display chinese characters in it. The database was actually a MS Access file first, that I converted into mysql with a program. De toute façon, many rows have chineseContinuer la lecture

Tagged , , | Laisser un commentaire

Search tamil fonts in mysql and php

How to search tamil fonts and retrieve data from mysql and show the result using php?… Continuer la lecture

Tagged , , , , | Laisser un commentaire

Code to Text (PHP, langues)

When I submit a post with AJAX that is not in English, I will get something similar to %u4F60%u662F%u5982%u4F55%u505A%uFF1F
What can I do to fix this in PHP? J'ai essayé utf8_decode… and doesn’t work.
I’m submitting the text with AJAX Continuer la lecture

Tagged , , , | Laisser un commentaire

Why is this preg_match() code returning true in PHP CLI and false in Apache

I’m trying to validate some Arabic text encoded in UTF-8 and running into unexpected results in PHP 5.3.8. Running the following snippet through CLI returns true and false through Apache.

var_dump(preg_match("/[[:alnum:]]/i", "عايش لهدف"));

I have mbstring.func_overload set to 7 et Continuer la lecture

Tagged , , , | Laisser un commentaire

MongoDB [MongoRegex] requête: working on localhost but empty results on server

I use MongoRegex to find cities starting with first characters of users’s input:

$search  = new MongoRegex('/^'.$_POST['search'].'/');
$results = iterator_to_array( $mongodb->cities->find(array('_id'=>$search)) );

On localhost (Sous Windows) $results contains array of cities, but on server (Debian) $results is always = empty array. Continuer la lecture

Tagged , , , | Laisser un commentaire

Troubles UTF8 dans un formulaire de contact php

Here is my contact function :

public static function contact_anon()
{
    $form = new Form('contact_anon');

    $form->field('email', 'text', array
    (
        'max_length'    =>  45,
        'valid_email'   =>  true
    ));

    $form->field('message', 'textarea', array
    (
        'max_length'    =>  400,
        'min_length'    =>  25
    ));

    if($data = $form->validate())
    

Continuer la lecture

Tagged , , , , | 1 Comment

Questions Charset lors du stockage de données RSS dans une table mysql

At the moment I’m reading rss feeds that may be encoded in any character type, utilisant simplexml_load_file();…
These feeds are then looped through in php and some parts are inserted into a mysql database that is utf8 with all tables Continuer la lecture

Tagged , , , , | Laisser un commentaire

Remplacer le caractère d'une «Â avec son entité html ā

I’m having a really hard time trying to replace a certain character with it’s entity equivalent. I tried to str_replace the characterābut it just wont work! I can’t see why. The code I use:

$content = str_replace('ā', 'ā',$content);

Continuer la lecture

Tagged , , | Laisser un commentaire

Autoriser uniquement (Anglais & Arabe) en UTF-8 du code

Je cherche une expression rationnelle de changer tous les non-anglais et / ou l'arabe en évidence “_”
Actuellement, j'ai le code suivant qui fonctionne mais je pense que j'ai le mauvais unicode
varier qu'il permet chinois & d'autres langues… Continuer la lecture

Tagged , , , | 1 Comment
12 pages