Paldo Posted June 1, 2009 Share Posted June 1, 2009 Hi guys could you please have a look at my code couse I realy don't know what could be a problem... I hope it's not a problem that names of my variables are in my native language, If it is I can translete it for you, but from previous experience that can couse diferences and other problems, I wanted it to be exactly the same stuff I use on my page... It says: Parse error: parse error in /3w/euweb.cz/p/parobek/zuzkeconfirm.php on line 29 I'll mark that line in code Thanks in advance for your time and help. <html> <body> <?php $cislovsringu = $_POST[cislo]; echo $cislovsringu; echo '<br>'; echo $cislovsringu{3}; echo $cislovsringu{1}; echo $cislovsringu{4}; echo '<br>'; $dlzka = strlen($cislovsringu); echo $dlzka; echo '<br>'; echo '<br>'; $poleHodnot = array( "1" => "jednotky" , "2" => "desiatky" , "3" => "stovky" , "4" => "tisicky" , "5" => "desatisicky" , "6" => "stotisicky" , "7" => "miliony" , "8" => "desatmiliony" , "9" => "stomiliony" , "10" => "miliardy" ); for ($i = $dlzka ; $i > -1; $i-- ) { // THIS IS LINE 29 THAT ERROR REFERS TO $polePoctu[$poleHodnot[$i]] = (int)cislovstringu[$i] ; } print_r($polePoctu); //1 364 720 434 ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
glenelkins Posted June 1, 2009 Share Posted June 1, 2009 i think you just need to change the for loop to for ( $i = $dlzka; $i > -1; $i = $i -1 ) Quote Link to comment Share on other sites More sharing options...
Paldo Posted June 1, 2009 Author Share Posted June 1, 2009 Well no It didn't work It prints the same error... Quote Link to comment Share on other sites More sharing options...
Jibberish Posted June 1, 2009 Share Posted June 1, 2009 The for loop is fine, however you have missed a $ on the next line it should be. <?php $polePoctu[$poleHodnot[$i]] = (int)$cislovstringu[$i] ; ?> Also, I dont know if they are suposed to be the same word but you have $cislovstringu and $cislovsringu, one has an extra t in it. Quote Link to comment Share on other sites More sharing options...
DarkSuperHero Posted June 1, 2009 Share Posted June 1, 2009 errors are usually within a few lines of specified line they are flaged. Quote Link to comment Share on other sites More sharing options...
Jibberish Posted June 1, 2009 Share Posted June 1, 2009 errors are usually within a few lines of specified line they are flaged. Helps keep you on your toes Quote Link to comment Share on other sites More sharing options...
Paldo Posted June 1, 2009 Author Share Posted June 1, 2009 Thank you all for your help it worked. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.