Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * PHP Array Replace Function
- *
- * @author jaideejung007 http://www.discuzthai.com
- * @copyright 2016 DiscuzThai
- * @license https://creativecommons.org/licenses/by/3.0/th/
- *
- * @version 0.1.1
- */
- $jjWord = "My name is <strong>{string1}</strong> <strong>{string2}</strong>, ID <strong>{string3}</strong>";
- $jjFind1 = "Anusuk";
- $jjFind2 = "Sangubon";
- $jjFind3 = "jaideejung007";
- $jjArrayFind = array(
- "{string1}",
- "{string2}",
- "{string3}"
- );
- $jjArrayReplace = array(
- $jjFind1,
- $jjFind2,
- $jjFind3
- );
- echo addslashes(str_replace($jjArrayFind,$jjArrayReplace,$jjWord));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement