Re: Parsing Help
| From: | Gremlins Mailing List | Date: | Fri, 03 Aug 2001 03:50:34 +0000 |
| Subject: | Re: Parsing Help | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-11019@lists.php.net to get a copy of this message | ||
Sharif
Use explode():
# split $netid into an array of strings using the space as the separator
$netids = explode(' ', $netid);
# create a link using each of the values in the resultant array
while(list($key, $value) = each ($netids)) {
echo "Contact:<a
href=http://www.blah.blah/cgi-bin/ph/blah?Query=$value>$value</a>";
}
hth
--
Jason Wong
Gremlins Associates
----- Original Message -----
From: Sharif Islam <mislam@students.uiuc.edu>
To: <php-db@lists.php.net>
Sent: Friday, August 03, 2001 4:29 AM
Subject: [PHP-DB] Parsing Help
>
> I have this table :
>
> service | netid |
> +-----------------------+-----------+
> | Email | netid1 |
> | Print | netid2 |
> | network | netid3 netid4 |
> | Database | netid2 |
>
>
> I am displaying it like this :
>
> echo "Contact:<a
>
> href=http://www.blah.blah/cgi-bin/ph/blah?Query=$netid>$netid</a>";
>
> Some records have only one netid with them , and some has two.
>
> I need to parse the netid1 and netid2 and display it as a two separate
> links. I am trying to use parse_str(str). Should I put a comman in
> between?. This creates problem in the link.It queries for netid, rather
> than netid .
>
> I know how to do it for normal string manupulation, but I can't figure it
out
> how to incorporate it here. Any hints?Thanks in advance.
>
>
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>