<!DOCTYPE html> <html> <body> <?php // Display result after replace and count echo preg_replace(array('/d/', '/s/'), '*', '1234567890', 8); ?> </body> </html>