我有以下代码
<?
php drupal_set_message("Your registration submission has been received.");
drupal_goto("/events-initiatives/events-listing");
?>
我想删除所有内容,但Your registration submission has been received.
这个消息会改变,所以我需要它是一个通配符。所以它也会说
<?php
drupal_set_message("Testing!!!");
drupal_goto("/events-initiatives/events-listing");
?>
但我不知道如何编写 PHP 代码,我目前的代码是
preg_replace('#(<?php drupal_set_message(").*?("); drupal_goto("/guidelines-resources/professionals/lending-library"); ?>)#', '$1$2', $string);
但这不起作用,其中的 ( 似乎有问题。
知道我该怎么做吗?