Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged format



« Prev 1 Next »
Breaks up an address (in this case returned by Advanced Custom Fields Location plugin) into it's components. Additionally, sorts a multidimensional array of locations alphabetically by state. This works for basic addresses assuming that address is in...
1 450 posted 9 years ago by devowhippit
Use: echo format_size(filesize("fichier")); Example result: 13,37 Ko
0 450 posted 9 years ago by zhyar
0 471 posted 10 years ago by focal55
Example call: $menuName = sleek_get_theme_menu_name('footer-menu')
0 625 posted 11 years ago by Huskie
Switches 'dd mm yyyy' to 'yyyy-mm-dd'
0 390 posted 11 years ago by nebojsac
The date format is dd/mm/YYYY but you can replace slashes by anything else.
0 439 posted 11 years ago by ptiswitz
1 621 posted 11 years ago by tudisco
Turns /n to <br> and /n/n to </p><p> Usage: echo stripslashes(nl2br(nls2p($text)));
0 433 posted 11 years ago by jmiller
Assumes that the record has a `name` field which represents the name of the location and always has a defined two character `country` field.
0 466 posted 12 years ago by iloveitaly
I written this code to parse apache log in common log formats. It may have problems with irresponsible formatting like non-concluded into quotes request line. I welcome any modifications to my snippet because it was written if short time and this is...
0 448 posted 12 years ago by mpontus
This snippet collects a date from a var and formats it into the correct format for database date entry
0 469 posted 13 years ago by daveismyname
this function formats a web address for use in a link.<br> echo formatWebAddress("google.com");<br> http://www.google.com/
1 400 posted 13 years ago by jlvallelonga
1 478 posted 13 years ago by martin_rusev
2 413 posted 13 years ago by blackf0rk
this function processes a URL that 'should' be a full url (i.e. http://something.com/dfsdfs/) and makes sure it contains http:// for easy inclusion as a link into a href attribute
0 359 posted 13 years ago by iloveitaly
Format date from yyyy-mm-dd hh:mm:ss TO yyyymmddhhmmss
1 587 posted 14 years ago by gfazioli
0 568 posted 14 years ago by morroida
This changes the date format from y-m-d to d-m-y on PHP
3 1499 posted 14 years ago by isaac
This changes the date format from y-m-d to d-m-y on PHP. It's easy to change the - to / or spaces...
0 603 posted 14 years ago by isaac
This changes the date format from d-m-y to y-m-d on PHP. It's easy to change the - to / or spaces...
1 742 posted 14 years ago by isaac
The code below will format 2008-01-30 10:58:32 to Jan 30, 2008 See the page http://us2.php.net/date for a complete list of formatting codes.
2 625 posted 14 years ago by meme
De aa-mm-dd a dd-mm-aa y al revé
3 471 posted 15 years ago by nicolaspar
Use this to format a phone number for display on a page.
1 566 posted 16 years ago by fbnewtz
« Prev 1 Next »