Jump to content

paolo

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Everything posted by paolo

  1. Hello people, i have a small problem with regex... 1. I have a string which contains HTML code of some Table Rows in this format: <tr id="systemhalfTableRow_(A|B)[NUMBER]">...dynamic content...</tr> Now i need to remove this table row from the string with all the other rows in it. 2. Lets say this is my string with my rows $tableRows = '<tr id="systemhalfTableRow_A1"><td>Hello</td></tr> <tr id="systemhalfTableRow_B12"><td>Hello</td></tr> <tr id="systemhalfTableRow_A2"><td>Hello</td></tr>'; 3. I want to delete the rows with the id A from 1 to 2 for($i = 1; $i <= 2; $i++) { $id = 'systemhalfTableRow_A' . $i; preg_replace(PATTERN, '', $tableRows); } 4. What should remain after that? <tr id="systemhalfTableRow_B12"><td>Hello</td></tr> I would like to use PREG Please helf me with this one Thank you! greetings, paolo
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.