קוד: בחירת הכל
<?php
$mmf1 = '000.Phone-0534100432.Date-2018-05-26.22:02:30
770.Phone-089493770.Date-2018-05-26.22:02:30';
foreach( explode("\r\n" , $mmf1) as $row) {
$data_row = explode("." , $row ) ;
$info = array();
foreach( $data_row as $data ) {
$data = explode ( '-' , $data );
switch ( count($data) ){
case 1 :
$key = strpos( $data[0] , ':' )? 'Time' : 'Folder' ;
$value = $data[0] ;
break ;
case 2 :
$key = $data[0] ;
$value = $data[1] ;
break ;
case 4 :
$key = $data[0] ;
$value = $data[3] . '/' . $data[2] . '/' . $data[1] ;
}
$info[$key] = $value ;
}
{ $all_info[$info['Phone']] = $info;}
}
$mmf2='0534100432=מנחם
089493770=נחייג ונשמע' ;
$name = '';
foreach ( explode ("\r\n" , $mmf2 ) as $row ){
$row = explode ( '=' , $row ) ;
$all_info[$row[0]]['name'] = $row[1] ;
}
foreach ($all_info as $info) {
echo "שם : ";
echo $info['name'] ;
echo " , טלפון : ";
echo $info['Phone'];
}