php preg_replace

preg_replace is a function which is use in regular expression.

<?php
    $preg = "aAAAA Bbbbb";
    echo preg_replace("([a-z])", "1", $preg);
?>

There $preg is a variable and we stored some strings in this variable.
preg_replace(); function is a builtin function which has three parameters.
First parameter is for regular expression condition, the second one is for
required output, and the last and third parameter is to select the variable
that in which variable you want to apply preg_replace() function.

Comments

Popular posts from this blog

WP register_post_type() with custom CMB2 meta box

Git post receive setup at server for git push to the production from local machine