Hello,
I have a problem that I have tried to repair in several ways, but I can not!
I've already looked into the str_replace()
function in php.net and nothing!
I have the following code:
$cod = '192.168.1.1';
$char = '300';
$arrayFind = array('[cod]', '[char]');
$arrayReplace = array($cod, $char);
for($i = 0; $i < count($arrayFind); $i++) {
$response = str_replace($arrayFind[$i], $arrayReplace[$i], '[cod]/[char]');
}
The str_replace()
only replaces [char]
, I'm new to PHP and I really like it, but I'm very confused now!