Closed

Simple PHP Article Spinning Syntax Project

This project received 5 bids from talented freelancers with an average bid price of $36 USD.

Get free quotes for a project like this
Employer working
Skills Required
Project Budget
$30-$250 USD
Total Bids
5
Project Description

I need a PHP script/function where i can pass in a search string, a replacement string and a article with nested spinning syntax. The function will then make replacements in the article in a single location where the search string is found in every possible variation of a top level spinning block. If there are multiple replacement in a variation sentence, then replace the first occurrence only. If there are no replacements possible in the entire article, return a blank string.

E.g. 1
Replace "Search string" with "Replacement string"
{Search string {Search string i am to replace|Search string and again Search string|Search string to replace}|Search string}

Since "Search string" is in every possible outcome, we can make the replacement. The output string would be
{Replacement string {Replacement string i am to replace|Replacement string and again Search string|Replacement string to replace}|Replacement string}

E.g. 2
Replace "Search string" with "Replacement string"
{Search string {No string here|Search string and again Search string|Search string to replace}|Search string}

Since the "Search string" is not on every replacement path, no replacement can be made.

I wrote this function in [url removed, login to view] and it took me around 3 hours, however my code is a bit slow. So instead of just porting it to PHP, i figured i would post the project here to see if someone else could do it better. I would like the script/function to be as fast as possible. And keep in mind that spinning blocks can be nested many levels.

My max budget is $40.

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online