Showing posts with label functions. Show all posts
Showing posts with label functions. Show all posts

PHP getimagesize()

Wondering how to find out the size of your image? getimagesize() returns a lovely array containing the height and width of the image, along with a few other bits of data. In fact, one of the array values is even a nice little string containing height="yyy" width="xxx" that can be used directly in an IMG tag.

See the php manual entry for more info on this, as well as a number of other nifty image data gathering functions.

PHP in JS?

Seems some clever people are porting php functions into a javascript library. At the very least the md5 function should come in handy. Not sure what the security implications of that are however. Check it out for yourself:

http://phpjs.org/functions/index