Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged regex
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This helps you stip anything from title. This example is from Symfony homepage.
0
542
posted 15 years ago by Zver
If you have a title, for something like a blog or product, and want to make an seo-friendly name to call it, here is a function.
SAMPLE INPUT:
$title = "This foo's bar is rockin' cool!";
echo make_seo_name($title);
//RETURNS:
//this-foos-bar-i...
10
1739
posted 16 years ago by jdstraughan
This will count sentences that end in . or ? or ! and have a space after them.
1
2074
posted 16 years ago by evanwalsh
This function uses the power of regexp to check if some bad word are on the text, also offers the posibility to change those word for something else. Examples:\r\n\r\n$texto = \'fuck off!\';\r\nfiltrado($texto); returns true since a bad word has been...
1
970
posted 16 years ago by oso96_2000
Worst title ever. Basically, this takes a string like:
"Check this out: http://snipplr.com/view/5759/replace-a-url-its-domain-name-and-create-link/" and replaces it with "Check this out: snipplr.com [with a link to the full URL]"
1
1119
posted 16 years ago by jaytee
This function can validate and parse UK postcode like SW1A 1AA in to formated array.
2
1377
posted 16 years ago by naz
When processing text for a search engine or analysis tool, code needs to strip out punctuation, formatting, spacing, and control characters to reveal indexable text. In international text there are hundreds of these characters, and some should be rem...
1
1016
posted 16 years ago by localhorst
Remove excess whitespaces from string
Remove espaços em branco em excesso de uma string
1
890
posted 16 years ago by rafaelmt