I've got a table with lots of content that assume the site and it's subdomains are on http:// New content is being created with https:// and we don't want to alter the old records but if they're called we want to change the http to an https. Not all links, just the ones that link back to the site. so I've got etc I could just set up an array with each subdomain but I figured it'd be more elegant to use preg_replace. What would I use as the search and replace values?
So you only want to replace http:// into https:// in some text? If all your subdomains are different (I mean subA, subB, etc.), I would use this one: $text=YOUR_TEXT_OR_SOME_STRING_WITH_DOMAINS_TO_BE_REPLACED; $text=preg_replace("/http:\/\/([A-Za-z0-9]+)\.domain\.com/", "https://$1.domain.com", $text); PHP:
hey i have an question , can be replaced a link from embbed page with javascript that using adnetworks nowdays and get only the link with echo $link; can be done these with php
not if it was a visit from the adzoned website, I do not know if you understand what I mean. get the link send the visits get the money you win i win , woila ,
You have a site that you want to use Javascript to change the links on. It's easy to get an array of all the links and to update them. You just have to own the site (or have users with a custom toolbar that you've written)