Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.21 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. PHP strlen() and width of string
  2. $str1 = '123456789';
  3. $str2 = 'akIOuNBGH';
  4.        
  5. $string = '1234567890';
  6. $string = sprintf("%'.-32s", $string);
  7. var_dump($string); //string(32) "1234567890......................"