Possible Duplicate:
How to parse and process HTML with PHP?
i have an array which contains all the scanned links from a regex format. but in the regex, for www.apple.com, it only has links such as /macbookair/ and /osx/, not http://www.apple.com/macbookair/. is there a way for me to set default values like 'http://www.apple.com/' before the values? that way they are working links. my regex is
/<a(?:[^>]*)href=\"([^\"]*)\"(?:[^>]*)>(?:[^<]*)<\/a>/is
is it worth me correcting the above regex? or is there a way to set the default value for an array? i would rather people not mention to use 'html dom' or something like that because i would rather just use one of the ways i suggested.