Skip navigation.
Home

Add new comment

I forgot to mention that he m

I forgot to mention that he must be totally unaware of preg_replace, which would have saved him lots of lines.
Example from the WTF: $dir=str_replace("\\","/",$dir); $dir=str_replace("//","/",$dir); $dir=str_replace("\\\\","/",$dir); $dir=str_replace("///","/",$dir); Much better solution: $dir = preg_replace("#[/\\]+#", "/", $dir);

Reply




*

  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <p> <br>
  • Web and e-mail addresses are automatically converted into links.