Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Lensflare it's a nested str_replace...
Though I don't see a particular reason why the array form of str_replace wasn't used.
https://php.net/manual/en/...
You need to start at the last str_replace - it takes an HTML document and then replaces value=/ with an absolut url.
The rest of the str_replace calls work on the result of the previous str_replace calls and replace one HTML tag / attribute after another.
array form would have been much clearer I think. -
@Frederick nope! We talked about it and concluded on not killing them for a reason:
People die but their code doesn't, send them into good code rehab and force them to refactor **and** document.
This way we get more good coders and get rid of bad coders. -
@melezorus34 technically if the input cannot be cast to a string then str_replace will return null.
-
@kwilliams https://php.net/manual/en/... no section here tells me about the null return thing.
Perhaps check your logs for errors? -
@melezorus34 I am mistaken it seems. But honestly I've avoided PHP like the plague for the last 5+ years.
Related Rants
oh boy... here we go again...
rant
cmsofdoom
phptsd
php