I have the following error:
Warning: preg_replace(): Unknown modifier ']' in xxx.php on line 38
This is the code on line 38:
<?php echo str_replace("</ul></div>", "", preg_replace("<div[^>]*><ul[^>]*>", "", wp_nav_menu(array('theme_location' => 'nav', 'echo' => false)) )); ?>
How can I fix this problem?
If you prefer to receive an exception (MalformedPatternException) instead of warnings or relying on preg_last_error(), consider using the T-Regx library: <?php try { return pattern('invalid] pattern')->match($s)->all(); } catch (MalformedPatternException $e) { // your pattern was invalid }
If you prefer to receive an exception (MalformedPatternException) instead of warnings or relying on preg_last_error(), consider using the T-Regx library:
See less