今天看了下正则表达式,忽然觉得可以把我现在手上的企业建站系统改一下。不过改来改去觉得还是仿DEDE的方式好一点。 /({t:*[^{]*\/}|{t:*[^}]*}([^{]|(?R))*{\/t:.*?})/i 但是对我于这个系统来说,那就简单得多,所以参照这个我做了以下的正则表达式 private
今天看了下正则表达式,忽然觉得可以把我现在手上的企业建站系统改一下。不过改来改去觉得还是仿DEDE的方式好一点。
/({t:*[^{]*\/}|{t:*[^}]*}([^{]|(?R))*{\/t:.*?})/i但是对我于这个系统来说,那就简单得多,所以参照这个我做了以下的正则表达式
private $preg_string = "/(<m:>|)/si";</m:>
$tag_arr数组的格式如下
然后用PHP的str_replace方式替换$tag_arr['str']
以下是源码
stemplate.class.php
index.php
<?php require './stemplate.class.php'; $template = new stemplate(); $template->display('index.htm');
index.htm
<meta http-equiv="Content-Type" content="text/html; charset=gbk"> <title>妯℃澘</title> <b>姝e父杈撳嚭</b><br> <?php echo '姝e父鐨凱HP杈撳嚭'; ?><br> <b>foreach寰</b>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
