Re: how to concat strings?
| From: | Alejandro | Date: | Wed, 07 Nov 2001 18:04:38 +0000 |
| Subject: | Re: how to concat strings? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73771@lists.php.net to get a copy of this message | ||
I need to concat 2 strings and the result to be a variable name. ie:
I need to concat "checkbox" and "1" so I would do:
$var=checkbox.1
and checkbox1 is a variable that already exist, so I want to print its
value. Something like: echo "$var" and the content of $checkbox1 must be
displayed. Any ideas??
Here is the source code:
<?
$checkbox1=hola;
$checkbox2=don;
$checkbox3=pepito;
$checkbox4=don;
$checkbox5=josé;
for ($i=1; $i<=5; $i++){
$var=checkbox.$i;
echo "variable nº $i:$var<p>";
}
?>