Wednesday, October 20, 2010

PHP Regular Expression Remove BBCODE

How to remove BBCODE from a string ?
 
<?php 
$String = "[b][color=#0000ff]TEST[/color][/b]";
$regex = '|[[\/\!]*?[^\[\]]*?]|si';
$String = preg_replace($regex, '', $String);
print $String."\n";
?>

Centos 7 reset root/ any user lost password / lockout due to cant remember password

1. Need to be in front of the terminal. (Physically if not vm). 2. Reboot the server 3. Press 'e' in the GRUB2 boot screen. 3. bunch...