Replace element using phpquery (php version of jquery)

razna

New Member
I want to replace all \[code\]<span>\[/code\] tags with \[code\]<p>\[/code\] using phpquery. What is wrong with my code? It finds the \[code\]span\[/code\] but the replaceWith function is not doing anything. \[code\]$event = phpQuery::newDocumentHTML(file_get_contents('event.html'));$formatted_event = $event->find('span')->replaceWith('<p>');\[/code\]This documentation indicates this is possible:
http://code.google.com/p/phpquery/wiki/Manipulation#Replacing
http://api.jquery.com/replaceWith/This is the html that gets returned with and without \[code\]->replaceWith('<p></p>')\[/code\] in the code:\[code\]<span class="Subhead1">Event 1<br></span><span class="Subhead2">Event 2<br> August 12, 2010<br> 2:35pm <br> Free</span>\[/code\]
 
Back
Top