Posts: 2,536
Location: Western Maryland
|
matt,
The problem is not with PHP, but with your browser and HTML in general. The spaces are there, but remember that browsers ignore extra spaces and line feeds and are doing so here.
Try this code:
PHP Code:
echo ('<option value="' .$row_add['user_id'].'">'
. padWithHTMLSpaces($row_add['username'],35). ' | '
. padWithHTMLSpaces($row_add['storename'], 25). ' | '
. padWithHTMLSpaces($row_add['companyname'], 25)
. '</option>');
// You'll need this little function
function padWithHTMLSpaces( $szin, $targetLength )
{
$szout = str_pad( $szin, $targetLength, " ", STRING_PAD_RIGHT );
return str_replace( " ", " ", $szout );
}
Hope this helps.
__________________
—Kyrnt
|