data type casting to numbers with intval() or doubleval()

Поиск
Список
Период
Сортировка
От imago
Тема data type casting to numbers with intval() or doubleval()
Дата
Msg-id 09fd01c0ce65$ccd14760$e875f718@imago
обсуждение исходный текст
Ответ на Converting POSTGRESQL timestamp to UNIX timestamp  (Richie <dugganr@student.cs.ucc.ie>)
Список pgsql-php
I am having a problem with the intval() function

I am using it to take string data and extract the number it would
represent if only numeric.

$my_integer = intval($my_string)

when the sting is numbers followed by letters -
$my_string = 4444mmm
$my_integer = 4444
it works as expected

but when letters are followed by numbers
$my_string = mmm4444
$my_integer = 0

Same problem with doubleval()

What am I missing????  how do I drop the non-numeric parts of a
string?

imago


В списке pgsql-php по дате отправления:

Предыдущее
От: Wesley Leonard
Дата:
Сообщение: Re: data type casting to numbers with intval() or doubleval()
Следующее
От: "Christian Marschalek"
Дата:
Сообщение: HTTP authentication