Re: Variable wildcards
| From: | Jason Bell | Date: | Thu, 11 Apr 2002 22:56:36 +0000 |
| Subject: | Re: Variable wildcards | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92677@lists.php.net to get a copy of this message | ||
Yeah, I thought so too, but variable variables doesn't seem to provide for
this.... to add a little bit of detail to what I am doing, it is a user
list, and I want to have a check box next to each user so that you can
select 1 or more users for deletion. Each checkbox will be named User$id
($id of course being the numerical id of the user in the database)
I did try doing somehting like $User{ereg ([0-9])} but it doesn't seem to
work, or I'm doing it wrong.
I guess maybe an easier way is if I could somehow drop all of the selected
id's into an array? Then I wouldn't need to worry about needing to determine
which variables exist.
----- Original Message -----
From: "Kevin Stone" <kevin@helpelf.com>
To: "Jason Bell" <jbell@barkingrat.com>; <php-general@lists.php.net>
Sent: Thursday, April 11, 2002 3:44 PM
Subject: Re: [PHP] Variable wildcards
> Sounds like what you want is Variable Variables.
> http://www.php.net/manual/en/language.variables.variable.php
>
> ----- Original Message -----
> From: "Jason Bell" <jbell@barkingrat.com>
> To: <php-general@lists.php.net>
> Sent: Thursday, April 11, 2002 4:24 PM
> Subject: [PHP] Variable wildcards
>
>
> are there wildcard characters for variables?
>
> Lets say that I have a varable that always starts with $user but then has
> the 2 digit user id attached to the end, so it could be $user12 or $user28
>
>
> is there a way to grab these? sort of like in unix standards, where I
could
> use user?? or user* ?
>
>
> Thanks!
>
>
>
>
>
>