Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
by parxal » Sat Nov 09, 2002 9:00 am
<p><a href="mailto:parsxeal@hotmail.com">parsxeal@hotmail.com</a></p>
how can i make this html code in php, and transofrm it to mail to a variable?
$mail = "parsxeal@hotmail.com"
-
parxal
- New php-forum User

-
- Posts: 40
- Joined: Thu Nov 07, 2002 5:58 am
by Oleg Butuzov » Sat Nov 09, 2002 2:08 pm
- Code: Select all
<?
$content="<p><a href=\"mailto:parsxeal@hotmail.com\">parsxeal@hotmail.com</a></p>";
preg_match('/<a href="mailto:([^<]*)">/', $content, $arr);
echo $arr[1];
?>
-
Oleg Butuzov
- Last Samuray

-
- Posts: 831
- Joined: Sun Jun 02, 2002 3:09 am
by parxal » Sun Nov 10, 2002 7:46 am
the email doesn't stay like a link!
it's supose to stay like a link.
-
parxal
- New php-forum User

-
- Posts: 40
- Joined: Thu Nov 07, 2002 5:58 am
by Oleg Butuzov » Sun Nov 10, 2002 9:12 am
I dont understand you what are you want to get
<p><a href="mailto:parsxeal@hotmail.com">parsxeal@hotmail.com</a></p>
This or this ?
-
Oleg Butuzov
- Last Samuray

-
- Posts: 831
- Joined: Sun Jun 02, 2002 3:09 am
by parxal » Sun Nov 10, 2002 12:21 pm
this do the work!
thanks anyway
$mail="parxal@hotmail.com";
print "<p><a href='mailto:".$mail."'>".$mail."</a></p>";
-
parxal
- New php-forum User

-
- Posts: 40
- Joined: Thu Nov 07, 2002 5:58 am
Return to PHP coding => General
Who is online
Users browsing this forum: No registered users and 3 guests