php search and replace first element in div

Posted by cnotethegr8 on Stack Overflow See other posts from Stack Overflow or by cnotethegr8
Published on 2011-03-17T07:54:17Z Indexed on 2011/03/17 8:10 UTC
Read the original article Hit count: 185

Filed under:
|
|
|
|

i have a structure that looks like this

<div class="table">
  <div> <p> name1 </p> <p> title1 </p> </div>
  <div> <p> name2 </p> <p> title2 </p> </div>
  <div> <p> name3 </p> <p> title3 </p> </div>
</div>

and it continues a few hundred more times. what can i write in php that will search ( class="table" > div ) and add a class to only the first 'p' in each 'div'?

© Stack Overflow or respective owner

Related posts about php

Related posts about html