473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Remove links for anchor tag <a href=\"/default/imp/compose.php?to=user1%40lakhi.com\"

5
Hi ,

I want to remove the anchor tag only if the anchor value is Email

the follwoing is source.

Expand|Select|Wrap|Line Numbers
  1. $text = "Forwarded message from <a href=\"/default/imp/compose.php?to=emsroot%40bdcarchive.in\" title=\"New Message emsroot@bdcarchive.in\">emsroot@bdcarchive.in</a><br>
  2. &nbsp;Subject: test message<br />
  3. &nbsp; &nbsp; &nbsp; To: <a href=\"/default/imp/compose.php?to=user1%40lakhi.com\" title=\"New Message to user1@lakhi.com\"> user1@lakhi.com </a><br />
  4. &nbsp; &nbsp; &nbsp; Cc: <a href=\"/default/imp/compose.php?to=user2%40lakhi.com\" title=\"New Message to user2@lakhi.com\"> user2@lakhi.com </a><br />
  5. &nbsp; &nbsp; &nbsp; BCC: <a href=\"/default/imp/compose.php?to=user2%40lakhi.com\" title=\"New Message to user.user3@lakhi.com\"> user3@lakhi.com </a><br />" ;

where ever the email with link,i want to display only email with our link.

Any suggetion or help would be appreciate.

Thanks inadvance
Aug 4 '10 #1
4 3600
dlite922
1,584 Expert 1GB
Take a look at preg_match and preg_replace.

Find a regex online that suffices for your links, many any tweaks as necessary.


Dan
Aug 4 '10 #2
Lakhi
5
am very new to PHP,basically java developer,no idea how to use these in php
Aug 4 '10 #3
Lakhi
5
i have this regexp <a href=[^>]* title=[^>]*>

which will find anchor tag <a href=\"/default/imp/compose.php?to=user1%40lakhi.com\" title=\"New Message to user1@lakhi.com\">
Aug 4 '10 #4
dlite922
1,584 Expert 1GB
The manual should help you understand how to use them:

http://php.net/preg_replace


Dan
Aug 4 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Dominic | last post by:
I have a home page on an intranet called default.asp I just type in the server name to take me to the default page http://server. The home page has an anchor name tag: <A name="fred">Freds Info</A>...
6
by: John Baker | last post by:
Hi: I wish to remove a field from a record, however when I try I am told that I cant remove it until I remove links to other records, and that the links will be showin in the links will show up...
3
by: Jan Vente | last post by:
Dear listmembers, Is it possible to change default values in the table design view. for example: De default value for the fieldsize of a textfield is 50. Could I change that value by default. I...
2
by: Nino | last post by:
Hello, I have done some searching through groups and haven't found an answer that suits my needs, so I hope to ask again. Is there a way to disable an anchor tag within HTML? Here's why: I...
2
by: Shimon Sim | last post by:
Hi I am writing some integration project. I need to create XML from object data but I don't need xml header and all the default namespaces. My current (testing) code is: Request request = new...
5
by: Coaster | last post by:
I added security using the asp.net web site configuration tool and now I want to remove it. I tried removing default provider via the asp.net settings but it won't let me. It gives an error stating...
5
by: smita232 | last post by:
HI , i have a code : <a href="#" >Hyperlink</a> Now how do i remove the anchor tag dynamically using Javascript?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.