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

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

c++ - Serialize a class with a Qlist of custom classes as member (using QDataStream) -

Read video using VideoReader function in Matlab? -