PHP function to replace a HTML node
$10-30 USD
Paid on delivery
This is a second attempt at posting this project.
We would like someone to create a php function that simply replaces a node within a HTML document.
We plan to loop a large number of HTML documents.
Inside the document is a node that we wish to replace.
The function should accept three parameters:
1) The original HTML
2) A string representing the opening tag of the node
3) A string representing the new node
The function should return the original HTML with the relevant node replaced.
The solution should use the DomDocument class unless there's a good reason suggested not to.
The solution should be generic and be able to handle any HTML, but as an example, this is what we are trying to achieve:
$sHaystack = "<html><div id='apple'><div id='pear'></div></div></html>";
$sNeedle = "<div id='pear>";
$sReplacementHTML = "Hello World"
$result = replaceHTMLInTag($sHaystack,$sNeedle,$sReplacementHTML)
echo $result;
Result is:
<html><div id='apple'>Hello World</div></html>
Project ID: #11637197
About the project
20 freelancers are bidding on average $34 for this job
Hi there! Did go through your Job Description and glad to share that I have experience in working with wordpress platform. I have more than four years of industry experience and have been the part of diverse industr More
yes, let's clarify the requirement in details also if you want us to share our skill and previous work let us know.. hope to hear you soon.. Thanks & Regards RIMSHA
Dear Hiring Manager, Thank you for this wonderful opportunity. I have excellent experience in Website Development & designing. I can finish this job within the given time frame as i can easily do it. I have 4+ y More
hello...we are expert...done like similar..can do it...come on chat...waiting....thanks
Hi, I am interested in your project " PHP function to replace a HTML node ". We will make a changes in your php function. Let's discuss more about the project and turn it into reality with your idea and o More
Dear Hiring Manager ! Before Awarding To Any Freelancer give me chance & Kindly Discuss your project with me. I have carefully read your requirement and got complete understanding of the project. I have more More
hi, Ready to start right now. I have experience in JavaScript, HTML, PHP and Java. Can provide quality and standard work. Please pm me for more details. Thank You
Hello there It is my great honor to apply for this vacant job. I am very hardworking and can work effectively as fast as I can. I have excellent skills in JAVA, C++, C#, OPPs, HTML5, CSS3, JS, AJAX, JQYERY, React.js, More
hello friend good day I can help you with your problem'm an expert in web pages and php realizaria the time necessary for you, I would love to help greetings
I've 5+ years of experience in PHP,MYSQL and all relevant CMS and framework in PHP. I can make this script using regular expression and str_replace function in php. And yes you can use it in any php project. I'm alr More