PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table `table` (id int, name varchar(64)); insert into `table` values (123, 'Test123');
Copy Clear
Copy Format Clear
<?php $msg = '[id]123[/id]'; $msg = htmlspecialchars(trim($msg)); $msg = preg_replace("#(^( |\r|\n)+)|(( |\r|\n)+$)|([^\pL\r\n\s0-9" . preg_quote(' []|`@\'ʼ"-–—_+=~!#:;$%^&*()?/\\.,<>{}№«»', '#') . "]+)#ui", '', $msg); $msg = preg_replace('/\[id\]([0-9]+)\[\/id\]/isU', '$1', $msg); print_r($msg);
Show:  
Copy Clear