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!
Does anyone have any ideas on why this won't work? I'm pulling a variables from the DB and I want to display them in a list evenly spaced out. But the str_pad function does not seem to be working so I must be doing something wrong:
It just the way html ignores multiple spaces and also appears to be the formatting allowed inside the <option> tags.
Eg if you do this just as a test you'll see it's ok (without any select tags, just plain old echo's) :
I'm not sure of the solution to get the correct spacing in the option tags, but maybe it's CSS related as using <pre> etc doesn't seem to work either around the select or inside the option tag
Problem with using is that it's 6 chars long and therefore can get trimmed at weird places in a str_pad, i.e you could end up with sp; for example.