Skip to content

Instantly share code, notes, and snippets.

@chihirokaasan
Created April 17, 2017 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chihirokaasan/9aece0810d4e3da9f5a3f90721cecccf to your computer and use it in GitHub Desktop.
Save chihirokaasan/9aece0810d4e3da9f5a3f90721cecccf to your computer and use it in GitHub Desktop.
sprintfとstr_replaceの合わせ技で半角スペース埋め
//結果 ’  12’
echo str_replace(" ", "  ", sprintf("%3d", 12));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment