**PHP**
$datearr = explode("/", $cutOff);
$month = $datearr[0];
$day = $datearr[1];
$year = $datearr[2];
$mainten = "MAINTENANCE";
$pad=' ';
$maint = str_pad($mainten, 20, $pad);
$string = $cduid . $maint . $inarea . $year . $month . $day . "\n";
I am trying to parse this line to the server, and $ maint should be padded with spaces on the right. I also tried .....
$datearr = explode("/", $cutOff);
$month = $datearr[0];
$day = $datearr[1];
$year = $datearr[2];
$mainten = "MAINTENANCE";
$maint = str_pad($mainten, 20);
$string = $cduid . $maint . $inarea . $year . $month . $day . "\n";
When I echo $ string $ maint has only 1 space on the right. If I replaced $ pad = ''; with $ pad = '.'; I get the correct result, but I need these to be spaces.
What am I missing here?
source
share