Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // if the $field_url is not present, proceed as normal
- if (empty($field_url)) {
- echo $content;
- // if the $field_url is present, format it as an actual url
- // the problem here is that $content may contain multiple urls, I want to do a regex
- // on only the $detected_field_url, even if the $detected_field_url is found multiple times in $content
- } else {
- $detected_field_url = preg_quote($field_url, '/');
- $formatted_url = '<a href="$detected_field_url">"$detected_field_url"</a>';
- $formatted_url = preg_quote($formatted_url, '/');
- // this is still not echoing anything, i think i am missing something dumb on my part..
- echo preg_replace($detected_field_url, $formatted_url, $content);
- }
- ?>
Add Comment
Please, Sign In to add comment