Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]is_integer i is_numeric
nowy_pehapowiec
post
Post #1





Grupa: Zarejestrowani
Postów: 220
Pomógł: 0
Dołączył: 24.08.2009

Ostrzeżenie: (0%)
-----


Przekazuje w adresie wartość zmiennej id=123. Po czym sprawdzam czy to jest integer
if( isset( $_GET['id'] ) && is_integer( $_GET['id'] ) )
i okazuje się, że nie. Ale jak dam is_numeric to przechodzi. Czemu?

pozdro
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 561
Pomógł: 6315
Dołączył: 27.12.2004




no przeciez masz to napisane w manualu!
http://pl2.php.net/manual/pl/function.is-int.php
Cytat
Find whether the type of a variable is integer


http://pl2.php.net/manual/pl/function.is-numeric.php
Cytat
Finds whether a variable is a number or a numeric string


ps: wszystko co przychodzi z GETa czy POSTA jest tekstem
Powód edycji: [nospor]:
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 27.12.2025 - 05:25