If you want actual X and Y pixel coordinates from latitude and longitude then you ought to say what range the pixel coordinates must be within...
For example if you want to draw a point (latitude, longitude) on a canvas and that canvas has a size of 500 pixels square then converting the latitude and longitude must take account of the canvas size.
Here's a couple of PHP functions that will convert latitude and longitude to floats which range from zero to one:
function lonToX($lon){
return ($lon/360)+0.5;
}
function latToY($lat){
return (abs((asinh(tan(deg2rad($lat)))/M_PI/2)-0.5));
}
Multiplying the results of each float value by 500 would then give the required (X, Y) pixel position on the canvas.
Something to watch for though is the projection used by your (latitude, longitude) coordinates.
The PHP functions will convert
WGS 84 coordinates.
WGS 84 is the projection used in Google Maps and many other coordinates systems BUT it is not the only project used.
Martin.