<?php
return str_replace(' ','%20',$input);
<?php
return str_replace(' ','%20',$input);
return str_replace('(','(',$input);
return str_replace(')',')',$input);
This question has been answered by multiple community members. See the first response.
$input = str_replace(' ','%20',$input);
$input = str_replace('(','(',$input);
return str_replace(')',')',$input);
Hi Andy,
I might know a solution. In your example you return in the first line. This way the other code doesn't get executed.
Try something like this:
$input = str_replace(' ','%20',$input); $input = str_replace('(','(',$input); return str_replace(')',')',$input);
Your lines 1 and 2 don't actually do anything, since they replace the character with itself. (though maybe the Forum mangled your original code).
Parentheses are allowed in URLS. What do you mean by 'when it passes through MODX, it seems to break'?
Your lines 1 and 2 don't actually do anything, since they replace the character with itself. (though maybe the Forum mangled your original code).
Parentheses are allowed in URLS. What do you mean by 'when it passes through MODX, it seems to break'?
$input = str_replace(' ','%20',$input);
$input = str_replace('##','(',$input);
return str_replace('##',')',$input);It sounds like pThumb is messing with the parentheses, maybe by calling PHP's urlEncode().
If that's the case, this code from andreasf should work, as long as the ## strings are replaced by whatever you see in the URL where the parentheses should be.
$input = str_replace(' ','%20',$input); $input = str_replace('##','(',$input); return str_replace('##',')',$input);

Hi Andy,
I might know a solution. In your example you return in the first line. This way the other code doesn't get executed.
Try something like this:
$input = str_replace(' ','%20',$input); $input = str_replace('(','(',$input); return str_replace(')',')',$input);