PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > PHP: Simple question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
PHP: Simple question

Réponse
 
LinkBack Outils de la discussion
Vieux 13/11/2007, 16h15   #1
Shelly
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut PHP: Simple question

In C and other languages I have had the need to convert from a character to
an integer. This is easy. Now, however, this is the first time I have had
to do this in PHP and I can't find the proper function. The reason I need
this is that upon downgrading to MySQL 4.0.7 (upon changing servers), data
that are in the tables contain characters that are not translated properly.
These characters are (at least two of them are) â and ?. I want to decode
part of the string to its integer representation to see how I can handle
this problem. Interestingly, the character T translates properly. The
actual sequence (or one of them) is â?T

I would love to avoid the necessity of fixing all those strings in the
database.

--
Shelly

PS: I included the PHP prefix label for the filtering challenged :-)


  Réponse avec citation
Vieux 13/11/2007, 16h34   #2
C. (http://symcbean.blogspot.com/)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP: Simple question

On 13 Nov, 15:15, "Shelly" <sheldonlg.n...@asap-consult.com> wrote:
> In C and other languages I have had the need to convert from a character to
> an integer.


try ord()

C.

  Réponse avec citation
Vieux 13/11/2007, 17h04   #3
Shelly
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP: Simple question

C. (http://symcbean.blogspot.com/) wrote:
> On 13 Nov, 15:15, "Shelly" <sheldonlg.n...@asap-consult.com> wrote:
>> In C and other languages I have had the need to convert from a
>> character to an integer.

>
> try ord()
>
> C.


Thanks, that worked. I knew it had to be simple.

--
Shelly


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 16h50.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07903 seconds with 11 queries