Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

preg_replace examples

$result = preg_replace('/abc/', 'def', $string);   # Replace all 'abc' with 'def'
$result = preg_replace('/abc/i', 'def', $string);  # Replace with case insensitive matching
$result = preg_replace('/s+/', '', $string);      # Strip all whitespaces
Source by lzone.de #
 
PREVIOUS NEXT
Tagged: #examples
ADD COMMENT
Topic
Name
8+1 =