What's the best way I can replace a random scale number on the end of a url so I can replace it with a different scale number?
New Urls I Need:
Here is what I came up with which is just a shot in the dark for me:
$output = preg_replace("/\\/scale;.*/","/scale;179x263/",$url_string);
If the replacement is always going to be the same, there will never be another path segment after the scale part, etc. then something like that might be sufficient. FYI, you can use different delimiters (e.g. <>) so you don't have to escape the literal slash (/) in your pattern.
What about the brackets around the wildcard(.*) don't they have to be there?