-1

I have the PHP code below, so my question is how can I refine it?

$slug                   = $_SERVER['REQUEST_URI'];
$myslug                 = substr($slug, 4);
$new_slug               = chop($myslug,"?lang=fr");
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
foolfell
  • 1
  • 1

1 Answers1

0

You could eliminate all those variables.

$slug = chop(substr($_SERVER['REQUEST_URI'], 4),"?lang=fr");
Mihai Aurelian
  • 224
  • 2
  • 6