[Solved] Export and download txt file using PHP assigning fixed spaces [closed]
Are you looking for str_pad? http://php.net/manual/en/function.str-pad.php str_pad(1, 3, ‘ ‘, STR_PAD_LEFT) will ” 1″. You could have an array telling how long each string should be and use $lenghts[$i] inside your loop to set the padding size solved Export and download txt file using PHP assigning fixed spaces [closed]