PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Is there a way i can return the len of a string in pixels? Or somehow convert the length to pixels? Im doing this because i want to resize the background of the image according to the length of the text.... Anyoen got any ideas?
wouldn't that work? just makes the image bigger for each character?
also it'd work best with a fixed width font (all characters take up one block, unlike ariel, comic sans, etc..).
whats how i was doing it to ebgin with, but sometimes it would be perfect, but then others with smaller strings it'd be too wide! And ya i thought about using a fixed font, but... i dunno... If there's no other way i will... But surely there is something!
you could either create the image with GD libraries then you could check the size of the string and resize, or you could put the image as a background for a table cell <TD> and make it 100% and put the text in the cell .... just a couple of ideas