3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '/<td.*?>.*?<p>(.*?)<\/p>.*?<\/td>/s'; $str = '<table width="652"> <tbody> <tr> <td colspan="2" width="652"> <p><strong>Test header</strong></p> </td> </tr> <tr> <td width="21"> <p>Nr.</p> </td> <td width="178"> <p><strong>Test2</strong></p> </td> </tr> <tr> <td rowspan="2" width="21"> <p>1</p> </td> <td rowspan="2" width="178"> <p>Test3</p> </td> </tr> </tbody> </table>'; $subst = '<td>$1</td>'; Echo "before: \n"; Var_dump($str); Echo "\n\nafter:\n"; $result = preg_replace($re, $subst, $str); Var_dump($result); //echo "The result of the substitution is ".$result;
Output for git.master, git.master_jit, rfc.property-hooks
before: string(326) "<table width="652"> <tbody> <tr> <td colspan="2" width="652"> <p><strong>Test header</strong></p> </td> </tr> <tr> <td width="21"> <p>Nr.</p> </td> <td width="178"> <p><strong>Test2</strong></p> </td> </tr> <tr> <td rowspan="2" width="21"> <p>1</p> </td> <td rowspan="2" width="178"> <p>Test3</p> </td> </tr> </tbody> </table>" after: string(187) "<table width="652"> <tbody> <tr> <td><strong>Test header</strong></td> </tr> <tr> <td>Nr.</td> <td><strong>Test2</strong></td> </tr> <tr> <td>1</td> <td>Test3</td> </tr> </tbody> </table>"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
55.25 ms | 1610 KiB | 4 Q