Færdiggjort

2 PHP Functions for finding and replaceing urls - NOT WEBSITE SCRAPING

I need two php functions to go through a string of formatted html and modify links.

Coders, ignore this next sentance, my original bid request was canceled because a RAC reviewer did not understand my original bid request.

THESE ARE EXAMPLE URLS, I DO NOT WANT CONTENT TO BE LOADED NOR SCRAPED FROM ANY WEBSITE, I WILL BE PROVIDING THE HTML CONTENT THROUGH A PROGRAMMING INTERFACE.

Example urls

< a href = "[url removed, login to view]">Visit Google< /a>

< a href = "[url removed, login to view]">Google's Stock is rising< /a>

< a href = "[url removed, login to view]">Google's New Plans< /a>

< a href = "[url removed, login to view]">Google's New Plans< /a>

The first function needs to scan the html and find all links and return an array of hrefs and anchor text

So for the given urls above I would expect an array:

$results['Visit Google'][0] = '[url removed, login to view]';

$results['Google's Stock is rising'][0] = '[url removed, login to view]';

$results['Google's New Plans'][0] = '[url removed, login to view]';

$results['Google's New Plans'][1] = '[url removed, login to view]';

I will take the output of this array and create a new array keyed numerically (0,1,2,3...) with modified urls.

The second function you will write will need to take this new array and replace the urls in html.

The order of the array from the first function should be the order the hrefs show up in the html so that I can create a new array with a foreach loop, and so you can take my array and do url replacement.

The order of urls in my array should be the order they appear in the html.

It is important that we not replace all [url removed, login to view] links with the same url, the urls need to be replaced in the same order as they appear in the array.

## Deliverables

I expect decent code - no copy paste please, and as I am a programmer working on a project that this will be used on I know good code when I see it. I'm not looking for perfect code, nor object oriented code. Just good solid code with decent code formatting and good variable names so the code is self documenting. code comments are encouraged to document regular expressions (if used) or hard to understand code blocks.

please use this coding standard:

function funcName( $param, $param )

{

}

if ( $var1 == $var2 || $var3!= $var4 )

{

}

else if ( $blah = 'horse' )

{

}

else

{

}

while ( expression )

{

}

for variable and function names please use camel caps instead of underscores:

i.e.

$thisIsMyVar

NOT

$this_is_my_var

or function urlReplace

NOT

function url_replace

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition BUT DO NOT NEED TO BE INSTALLED FOR BUYER 3) All deliverables will be considered "work made for hire" under U.S. Copyright law.

THE NEXT SENTANCE IS VERY IMPORTANT TO ME ON THIS PROJECT - ESPECIALLT THE NO GPL, GNU, OR 3RD PARTY COMPONENTS

Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc)

## Platform

Here are the function signatures I want.

function findUrls( $html )

This needs to return the array of urls like specified above.

function urlReplace( $html, $urlReplacements )

This needs to return the modified html.

Platform:

PHP / HTML

Evner: Ingeniørarbejde, MySQL, PHP, Software Arkitektur, Software Testning, Web Hosting, Hjemmeside Management, Hjemmeside Testning

Se mere: yahoo original programming, while loop c programming, website to find coders, website for finding a programmer, website create in my self, website coding for hire, use regular expressions, string standard functions in c, return oriented programming, regular expressions example, regular expression or example, regular expression functions, regular expression function, regular expression example, regular expression code, project reviewer, programming functions, programming expression, programmer for hire website, php string to html

Om arbejdsgiveren:
( 13 bedømmelser ) TOPEKA, United States

Projekt ID: #3311838

Tildelt til:

siluvw

See private message.

$21.25 USD in 3 dage
(108 bedømmelser)
4.7

5 freelancere byder i gennemsnit $32 på dette job

onemall

See private message.

$34 USD in 3 dage
(166 bedømmelser)
7.1
bahe

See private message.

$42.5 USD in 3 dage
(147 bedømmelser)
6.5
eilyasoft

See private message.

$21.25 USD in 3 dage
(62 bedømmelser)
4.8
gryzz

See private message.

$42.5 USD in 3 dage
(0 bedømmelser)
0.0