Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2009
    Thanked 0 Times in 0 Posts

    Replacing long urls with is.gd shortened urls

    I have a variable which holds only a string, and this string may contain an unlimited amount of urls inside of it. I already have a function I put together that accepts one argument, the URL to shorten, and returns the is.gd shortened url as a string. Now, what I would like to do, is for each long URL in the original string, i would like to run that URL through my shortening function, and replace the long URL with the newly shortened URL. Sorry if it is not clear what I want, go ahead and ask questions.

  • #2
    New Coder
    Join Date
    Mar 2009
    Thanked 14 Times in 14 Posts

    Thumbs up


    What I can suggest on a first look, this depends of using the next two php function: explode and combine.
    The goal of combine is that you keep old urls as array keys and keep they unique ( if in the input some urls are used more than once ).
    Hope it helps!


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts