<?php $target = "tatat"; //左寄せ寄せ $pad = str_pad($target,10,"-",STR_PAD_LEFT); echo $pad.'<br>'."\n"; //右寄せ寄せ $pad2 = str_pad($target,10,"-",STR_PAD_RIGHT); echo $pad2.'<br>'."\n"; //中央寄せ寄せ $pad3 = str_pad($target,10,"-",STR_PAD_BOTH); echo $pad3.'<br>'."\n"; ?>参考サイト