Advertisement

09.15.2008 at 01:27PM PDT, ID: 23733272 | Points: 500
[x]
Attachment Details

add .php extension onto certain links contained in string

Asked by JPERKS1985 in PHP Scripting Language

I have links that look like

/event-tickets/733893/New-York-Yankees-vs.-Chicago-White-Sox

/event-tickets/896377/Chicago-White-Sox-vs.-TBD---ALDS-Home-Game-2-(If-Necessary---Date-TBD)

I need a php regex routine that goes link by link contained in a string and adds .php on the end of the links it finds. As you may guess, the "/733893/New-York-Yankees-vs.-Chicago-White-Sox" text varies on each link. After the routine the link should look like this,

/event-tickets/733893/New-York-Yankees-vs.-Chicago-White-Sox.phpStart Free Trial
 
Loading Advertisement...
 
[+][-]09.15.2008 at 01:32PM PDT, ID: 22482542

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.15.2008 at 01:38PM PDT, ID: 22482606

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.16.2008 at 12:58PM PDT, ID: 22492600

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628