my goal is to find when a .pdf is linked and automatically generate text "(PDF)" outside the anchor </a> if its not already specified. what is the pattern for this?
Code: Select all
$pattern = '/.pdf">(.*?)<\\/a>..^pdf/i';How do I say replace only if "pdf" isnt in the range of 0-5 after the "</a>" ?
Here's what I'm replacing with:
Code: Select all
$replacement = '.pdf">$1</a> (PDF)';Link Example would be Link Example (PDF)
Thanks!