Can anyone suss why this code:
<?php
$N='strOne';
$L='strTwo';
$N=str_pad($N,15,STR_PAD_RIGHT);
echo($N.$L);
?>
produces this output:
why is it padding with 1's instead of the default spaces ??
When i call str_pad with just the required args (string subject, padding length)
i.e.
]<?php
$N='strOne';
$L='strTwo';
$N=str_pad($N,15);
echo($N.$L);
?>
it produces this:
I thought it may be because i'm not using the third optional arg, pad_string so i included an extra pair of empty commas to denote its absence thus:
$N=str_pad($N,15,,STR_PAD_RIGHT);
This, though, generates an error pointing out the presence of the extra ',' in the str_pad() func
Its explained in the php manual as easy as falling off a log - yeah, in theory!!