ASP has a MeasureString function that returns the width, in pixels, of a string given a certain font/size. Is this possible in PHP?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, using GD library.
http://www.php.net/manual/en/function.imagettfbbox.php
this is for text rendered on an image.
Text width varies a bit depending on the browser, OS (font smoothing, different rendering)