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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.