tags:

views:

87

answers:

3

How to get x y coordinates of an image in php?

I have an image $image = images/abc.png;

how to get the coordinates of the image using php.

A: 

Assuming you mean width and height you would do:

$img = imagecreatefromjpeg("img.jpg");
$w = imagesx($img);
$h = imagesy($img);

EDIT: if you want to know where an image is on the screen that is not a job for PHP but for a client-side language, like JavaScript

nico
A: 

if you're talking of image dimensions, getimagesize() function is for you

Col. Shrapnel
A: 

http://www.plus2net.com/php_tutorial/php_image_coordinates.php

This will help u..