php - divide data with a character from value database -
i have data database, :
$data = "abcdefghi";
i want divide data each of 3 characters, , added character newline. confused did count characters split. know use modulo ( % 3)
, if print :
abc def ghi
i not know syntax should used. can me?
$data = "abcdefghi"; $newdata = implode("\n", str_split($data, 3)); var_dump($newdata);
Comments
Post a Comment