Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]problemy z rzutowaniem
styx
post
Post #1





Grupa: Zarejestrowani
Postów: 138
Pomógł: 3
Dołączył: 21.11.2005

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


mam taki kod:

  1. <?php
  2. $ile = (int)$html[2];
  3. ?>


zmienna $html[2] jest typu: string(8) "2"
zmienna $ile po użyciu rzutowania jest typu: int(0)

pytanie:
dlaczego rzutowanie się nie powiodło i mimo iż string był liczbą 2 to po rzutowaniu w $ile mam 0 ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
styx
post
Post #2





Grupa: Zarejestrowani
Postów: 138
Pomógł: 3
Dołączył: 21.11.2005

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


array(12) {
[0]=>
string(46) ""
[1]=>
string(5) ""
[2]=>
string(8) "2"
[3]=>
string(4) ""
[4]=>
string(35) "m_braniewo"
[5]=>
string(5) ""
[6]=>
string(3) ""
[7]=>
string(336) "xxxxxxxxxxxxxxxxxxxxxxx

braniewski
warmińsko-mazurskiexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
[8]=>
string(3) ""
[9]=>
string(259) "xxxxxxxxxxxxxxxxxxxx
mazowieckiexxxxxxxxxxxxxxxxxxxxxxxx"
[10]=>
string(6) ""
[11]=>
string(0) ""
}

nie no bezsens totalny, wymiękam...

Ten post edytował styx 4.10.2007, 14:56:11
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: 26.12.2025 - 16:16