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 671 posted 10 years ago by devowhippit
Use: echo format_size(filesize("fichier")); Example result: 13,37 Ko
0 671 posted 11 years ago by zhyar
0 642 posted 12 years ago by focal55
Example call: $menuName = sleek_get_theme_menu_name('footer-menu')
0 852 posted 12 years ago by Huskie
Switches 'dd mm yyyy' to 'yyyy-mm-dd'
0 584 posted 12 years ago by nebojsac
The date format is dd/mm/YYYY but you can replace slashes by anything else.
0 609 posted 13 years ago by ptiswitz
1 848 posted 13 years ago by tudisco
Turns /n to <br> and /n/n to </p><p> Usage: echo stripslashes(nl2br(nls2p($text)));
0 598 posted 13 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 620 posted 13 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 655 posted 14 years ago by mpontus
This snippet collects a date from a var and formats it into the correct format for database date entry
0 668 posted 14 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 560 posted 14 years ago by jlvallelonga
1 681 posted 14 years ago by martin_rusev
2 618 posted 14 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 495 posted 14 years ago by iloveitaly
Format date from yyyy-mm-dd hh:mm:ss TO yyyymmddhhmmss
1 886 posted 15 years ago by gfazioli
0 823 posted 15 years ago by morroida
This changes the date format from y-m-d to d-m-y on PHP
3 2051 posted 15 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 875 posted 15 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 1066 posted 15 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 867 posted 16 years ago by meme
De aa-mm-dd a dd-mm-aa y al revé
3 658 posted 16 years ago by nicolaspar
Use this to format a phone number for display on a page.
1 776 posted 17 years ago by fbnewtz
« Prev 1 Next »