Jump to content

[SOLVED] Parse error PLEASE HELP


Paldo

Recommended Posts

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>



Link to comment
https://forums.phpfreaks.com/topic/160473-solved-parse-error-please-help/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.