Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged convert
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Takes a number in bytes and returns the number in (KB,MB,GB) for human-readable format.
1
723
posted 15 years ago by stancox
Ever needed to convert rgb to hex on your website, maybe you have a slider that handles rgb but your backend uses hex, this issue can be resolved easily be using the following code. Remember to keep in mind that php and html primarily uses hex colo...
1
873
posted 15 years ago by scopefragger
This function converts file size in bytes to the larger units.
You can add bigger values like exa-, zetta-, yotta- bytes.
0
798
posted 15 years ago by kirik
Recently moved my Wordpress blog to a tumblr account while I was removing a hosting account, wrote this script to do the transfer for me using Wordpress' Export feature and Tumblr's API.
It's rough around the edges but gets the job done!
2
1389
posted 15 years ago by shakefon
To convert links on a twitter status to a clickable url. Also convert @ to follow link, and # to search
3
1218
posted 15 years ago by mardix
So. You have some minutes and want a "human readable" version? Sure thing baby!
2
6372
posted 15 years ago by optimal
PHP
Convert incorrectly-formatted UTF-8 strings of HTML into correctly-formatted UTF-8 strings of plain text.
Useful for taking incorrectly-formatted UTF-8 strings containing HTML data, and converting them to correctly-formatted UTF-8 plain text.
A handy tool for displaying HTML stored in a database.
4
1926
posted 16 years ago by X3Maverick
My friend Jamal Fanaian showed me how to convert a string to its' ASCII value.
0
3218
posted 16 years ago by luizlopes
Convert an number to a position / ranking. 1 becomes 1st, 2 becomes 2nd, etc...
2
1146
posted 16 years ago by distinctdev
Diese Funktion wendelt Entities in HTML Quellcode um, ohne dabei den HTML Quellcode zu zerstören.
1
942
posted 16 years ago by OscarWilde
Convert 12hs format to 24hs format. In example: 10:00:00 a.m. return timestamp for 22:00. Or use: strtotime('1970-01-01 '.$hora);
1
790
posted 17 years ago by nicolaspar