faqts : Computers : Programming : Languages : PHP : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 12 people (83%) answered Yes
Recently 3 of 5 people (60%) answered Yes

Entry

The second field in the database is an emailadress. How can i use the printf() function so that $myrow[1] get a <a href="mailto: .... tag. ?

Jun 8th, 2000 00:42
Richard Heyes, Jan-Borge Landro,


Try this:
printf('<A HREF="mailto:%s">%s</A>',$myrow[1],$myrow[1]);
One %s for each variable, even if it's the same variable. You could 
alternatively use this method too:
echo '<A HREF="mailto:'.$myrow[1].'">'.$myrow[1].'</A>';