- var_dump: documentation ( source)
- str_replace: documentation ( source)
<?php
function decodeString($string){
$foo = "foo1";
$string = str_replace("foo", $foo, $string);
return $string;
}
$foo = "hello foo world";
var_dump(decodeString($foo));