Question: I would like to have the $x change as the value of x changes in the loop. What is the correct syntax to do this?

```
for ($x = 0; $x <= 3; $x++) {?>
   <input type="hidden" name="a_line_array1['.$x.']" value="
      <?=$v_resource_id; ?>"/>
   <input type="hidden" name="a_line_array2['.$x.']" value="
      <?=$v_category_name; ?>"/>
   <input type="hidden" name="a_line_array3['.$x.']" value="
      <?=$v_website_name; ?>"/>
   <input type="hidden" name="a_line_array4['.$x.']" value="
      <?=$v_webaddress; ?>"/>
   <?php 
   } 
   ?>

```

Answer: 
You for loop needs to look like this : 

```
for ($x = 0; $x <= 3; $x++) {?>
   <input type="hidden" name="a_line_array1[<?php  echo $x; ?>]" value="
      <?php  echo $v_resource_id; ?>"/>
   <input type="hidden" name="a_line_array1[<?php  echo $x; ?>]" value="
      <?php  echo $v_resource_id; ?>"/>
   <input type="hidden" name="a_line_array1[<?php  echo $x; ?>]" value="
      <?php  echo $v_resource_id; ?>"/>
   <input type="hidden" name="a_line_array1[<?php  echo $x; ?>]" value="
      <?php  echo $v_resource_id; ?>"/>
   <?php 
   } 
 ?>

```

I suggest you learn how to concatenate values in PHP and how to mix PHP and HTML.
Update from Julien Lachal's answer:

```
<?php
for ($x = 0; $x <= 3; $x++) {?>
   <input type="hidden" name="a_line_array1[<?=$x?>]" value="<?=$v_resource_id=?>"/>
   <input type="hidden" name="a_line_array1[<?=$x=?>]" value="<?=$v_resource_id?>"/>
   <input type="hidden" name="a_line_array1[<?$x=?>]" value="<?=$v_resource_id=?>"/>
   <input type="hidden" name="a_line_array1[<?=$x=?>]" value="<?=$v_resource_id=?>"/>
   <?php 
   } 
 ?>

```