3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 0 => [ "product_id" => 219, "product_description" => "<table style=\"color:; text-align: left;\"> <tr> <td> Processor: </td> <td> Intel Core 2 Duo - E8400 </td> </tr> <tr> <td> Clock speed: </td> <td> 3.0 GHz </td> </tr> <tr> <td> Memory: </td> <td> 4 GB </td> </tr> <tr> <td> Hard disk: </td> <td> 250 GB </td> </tr> <tr> <td> Video-adapter: </td> <td> VGA, Display </td> </tr> <tr> <td> Netwerk card: </td> <td> 1000 Mbps LAN </td> </tr> <tr> <td> Optical drive: </td> <td> DVD-Rewriter </td> </tr> <tr> <td> Operating system: </td> <td> Windows 7 or 10 Pro </td> </tr> <tr> <td> Warranty: </td> <td> 1 year </td> </tr> </table>"] ]; $arr = array_pop($a); $str = $arr["product_description"]; $stripped = strip_tags( $str, "<td>" ); $replaced = str_replace( "</td>", "", $stripped ); $arr = explode( "<td>", $replaced ); array_shift( $arr ); $arrKeyVal=[]; for( $i=0, $max = count( $arr ); $i < $max; $i+=2 ) { $key = trim( $arr[$i],"\r\t\n :" ); $arrKeyVal[strtolower( $key )] = trim( $arr[$i+1] ); } print_r( $arrKeyVal );
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [processor] => Intel Core 2 Duo - E8400 [clock speed] => 3.0 GHz [memory] => 4 GB [hard disk] => 250 GB [video-adapter] => VGA, Display [netwerk card] => 1000 Mbps LAN [optical drive] => DVD-Rewriter [operating system] => Windows 7 or 10 Pro [warranty] => 1 year )

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:
95.65 ms | 406 KiB | 5 Q