Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: keeping text in line


Message #1 by "Richard D. Williams" <appgrp@e...> on Tue, 20 Feb 2001 11:10:52 -0600
I should have clarified:  If you use printf() or sprintf() to pad with
spaces, it will only work if the whole thing is inside a <pre>
element; otherwise the whitespace characters will all compress into a
single space.

Something like this:

<pre>
  <?php

    printf ("%-30.30s%.3d", $student, $stuhrs);
    echo ("  ________________________<br />");

  ?>
</pre>

I can't test that code right now, so chances are high that there's a bug.

-- Christopher


  Return to Index