Code: Select all
<?php
$email_search = "([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})";
$email_replace = "******";
echo preg_replace($email_search, $email_replace, $row->txt);
?>Moderator: General Moderators
Code: Select all
<?php
$email_search = "([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})";
$email_replace = "******";
echo preg_replace($email_search, $email_replace, $row->txt);
?>Code: Select all
<?php
$email_search=<<<TEXT
Name E-Mail Address
------------------------------------------------
Inky T. Ghost inky@pacman.example.com
Donkey K. Gorilla kong@banana.example.com
Mario A. Plumber mario@franchise.example.org
Bentley T. Bear bb@xtal-castles.example.net
TEXT;
$email_replace= '*************';
print preg_replace('/[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}/',
$email_replace, $email_search);
?>Code: Select all
<?php
$replace = array("1"=>"one","2","two","([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})"=>"[***]");
echo preg_replace($replace, $row->txt);
?>Code: Select all
^((їA-Za-z0-9]+_+)|(їA-Za-z0-9]+\-+)|(їA-Za-z0-9]+\.+)|(їA-Z
a-z0-9]+\++))*їA-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.їa-z
A-Z]{2,6}$Yes and no.ol4pr0 wrote:Oke.. thanks. however i made a dumb mistake
the $row->text wasn't really thereOuch.
Inquery.
Could i do something like this by the way, I haven't tried it yet.
Code: Select all
<?php $replace = array("1"=>"one","2","two","([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})"=>"[***]"); echo preg_replace($replace, $row->txt); ?>
Code: Select all
<?php
$replace = array("1"=>"one","2","two","([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})"=>"[***]");
echo preg_replace($replace, $row->txt);
?>