php - Fastest way to match uri string -
The following code is in my site's No Regex is required and it is super fast. index.php file and every time a page runs my The website has been inquired, both of these need to execute
requirement on their own
404 error pages, so do not worry about this to do so within PHP What is the best performing way?
$ cache = $ _SERVER ['REQUEST_URI']; If (preg_match ('/ ^ \ / blog /', $ cache) || pre_match ('/ ^ \ / portfolio /', $ cache)) {Define ('WP_USE_THEMES' is true); // Loads WordPress Environment and Template Required ('./wordpress / wp-blog-header.php'); } Else {// Load codeigniter is required ('./ codeigniter / index.php'); }
$ cache = $ _SERVER ['REQUEST_URI']; If (0 === Stropo ($ cache, '/ blog /') || 0 === Stropo ($ cache, '/ portfolio /')) {Define ('WP_USE_THEMES' is true); Requires ('./ WordPress / WP-blog-header.php'); } Other {required ('./ codeigniter / index.php'); }
Comments
Post a Comment