I have 5 inputs rip, name,address, montant,date I want join them in one array line by line

if (isset($_POST['submit'])) {
        $RIB = $_POST['RIB'];
    $NAME = $_POST['name'];
    $ADDRESS = $_POST['address'];
    $MONTANT = $_POST['montant'];
$RIBS = explode("\n", str_replace("\r", "", $RIB));
$NAMES = explode("\n", str_replace("\r", "", $NAME));    

     foreach ($NAMES as $NAME) {
         $NAME = substr($NAME, 0, 49);
             $sln2 .= $NAME;    
}
    foreach ($RIBS as $RIB) {
        $RIB = substr($RIB, 0, 35);
        $RIB = preg_replace('/\\s/','',$RIB);
        $str = rtrim($RIB) . str_repeat(' ', 4);
            $sln1 .= $str;

  }  
  }

I want my code looks like that

5522156464    jack   add1    2354   05-05-2019
9965878457    sara   add2    58799   03-05-2019
5687987878    jack   add3    20441   01-05-2019

0 Answers