3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $val = '<input type="radio" name="alright" id="alright-1" value="1">'; echo preg_replace( '/<input([a-zA-Z_0-9 ={}"]*)type="radio"([a-zA-Z_0-9 ={}"]*)name="alright"([a-zA-Z_0-9 ={}"]*)value="1">/', '<input$1type="radio"$2name="alright"$3value="1" checked>', $val );
based on 7aNBR
Output for 4.3.0 - 7.2.0
<input type="radio" name="alright" id="alright-1" value="1">