Jump to content

[SOLVED] Quick question


mtylerb

Recommended Posts

I'm trying to match and replace any "?" and "/" characters as well as anything after and including the "." in a URL, this would match the ending part, right?

 

<?php
$areaSlug = preg_replace('/^(\.)\w*(ht)+(\w)*/', '',$topSlug[1]);
?>

 

Can I do this to also match the question mark and slash:

 

<?php
$areaSlug = preg_replace('/(^(\.)\w*(ht)+(\w)*)(\?)+(\/)+/', '',$topSlug[1]);
?>

Link to comment
https://forums.phpfreaks.com/topic/131482-solved-quick-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.