Do you want to choose the value before?clear_cache=Y



  • Got it. url with the following address: site.ru/content/grazhdanskie-spory?clear_cache=Y

    I need to get it.

    site.ru/content/grazhdanskie-spory/grazhdanskie-spory 
    

    I'm sorry.

    $url = preg_replace("#^/content/([a-zA-Z-])+#",$1","site.ru/content/grazhdanskie-spory?clear_cache=Y"); 
    

    But not how to fix it?



  • That's what you need.

    preg_replace("/\?.*/", "$1/grazhdanskie-spory", "site.ru/content/grazhdanskie-spory?clear_cache=Y");
    

    // site.ru/content/grazhdanskie-spory/grazhdanskie-spory




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2