Welcome To Snipplr
Everyone's Recent Snippets Tagged php
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
3718
posted 17 years ago by jdstraughan
Substitute and update keywords like $HeadURL$, $Revision$, etc. in a file on every commit to subversion repos.
1. Set svn:keywords on repos:
$ svn propset --recursive svn:keywords 'HeadURL Revision LastChangedBy Date' /path/to/repo
2. Use this...
0
1697
posted 17 years ago by zingo
Magic Quotes is a great feature of PHP but sometimes it can just get annoying. It's simple enough to turn it off at the .ini and restart apache but here's a quick .htaccess workaround
2
1826
posted 17 years ago by aristoworks
Been wanting to made one of these for a while and finally I got round to it.
For some examples please visit the post:
http://www.dom111.co.uk/blog/coding/db/8
Any comments suggestions appreciated.
CreativeCommons ShareAlike
3
3047
posted 17 years ago by dom111
Change only $start variable with your start year.
This very simple code will display two dates the next year like this :
© Copyright 2008 - 2009, All Rights Reserved.
and so on...
1
1366
posted 17 years ago by Pat64
This is a simple base for an approximate search application. You can currently use this to do search's but it, is not very sophisticated, right now anything that is as difference in characters base on the threshold will show up in the result, so with...
3
1512
posted 17 years ago by Cory
The “2>&1″ bit tells to pipe the standard error to the standard output. Otherwise the standard error may not be outputted by the system and you won’t have a way to troubleshoot your script.
2
1933
posted 17 years ago by jdstraughan
http://us.php.net/manual/en/language.oop5.autoload.php#82614
2
1597
posted 17 years ago by luizlopes
A simple method of validating an IP address using PHP and regular expressions
2
4462
posted 17 years ago by aristoworks
This is a simple method of validating a 9-digit zip code using PHP and regular expressions
3
3646
posted 17 years ago by aristoworks
A simple method of validating an email address using PHP and regular expressions
4
2640
posted 17 years ago by aristoworks
A simple method of validating a telephone number using regular expressions and PHP
3
2856
posted 17 years ago by aristoworks
This is like a cms for a stylesheet - includes all files to make a working xhtml/css demo
1
1604
posted 17 years ago by perthmetro
This will count sentences that end in . or ? or ! and have a space after them.
1
3093
posted 17 years ago by evanwalsh