Skip to content

Instantly share code, notes, and snippets.

@binarykore
Last active May 26, 2023 10:33
Show Gist options
  • Select an option

  • Save binarykore/1245fbb5ab7cc19915eb0bd44d16766a to your computer and use it in GitHub Desktop.

Select an option

Save binarykore/1245fbb5ab7cc19915eb0bd44d16766a to your computer and use it in GitHub Desktop.
String Interpolation using PHP Regular Expression and Preg_Replace Function..
<?php
$_string = "username=admin";
$_string = preg_replace("/username\=(\w+)/",'<li>${1}</li>',$_string);
echo($_string."\r\n");
//String Interpolation using PHP Regular Expression..
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment