PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $chapitre_name = "7 5 10 7 21 17 68 {63} {315}"; $regex = '~\{([^}]*)\}~'; // preg_match_all($regex, $chapitre_name, $matches); // var_dump($matches); $chapitre_id = '646'; $chapitre_name = preg_replace_callback( $regex, fn($matches) => sprintf( '<input type="text" name="%s" value="%s" size="%d" />', $chapitre_id, $matches[1], strlen($matches[0]) ), $chapitre_name ); echo $chapitre_name;
Show:  
Copy Clear