Verileri ayrıştırmak için PHP, Düzenli ifade

0 Cevap php

Ben formatta veri var:

Futbol - Oyun için 101 Carolina Panthers 15 -110

Futbol - Oyunu için 36 ½ -110 altında 101 Carolina Panthers / Pittsburgh Steelers

Futbol - 1. yarısında 102 Pittsburgh Steelers -9 -120


PHP diziye bu dönüşümü nasıl:

$game_data[] = array( 'sport_type'  => 'Football',
                      'game_number' => 101,
                      'game_name'   => 'Carolina Panthers',
                      'runline_odd' => '+15 -110',
                      'total_odd'   => '',
                      'odd_type'    => 'runline',
                      'period'      => 'Game' );

$game_data[] = array( 'sport_type'  => 'Football',
                      'game_number' => 101,
                      'game_name'   => 'Carolina Panthers/Pittsburgh Steelers',
                      'runline_odd' => '',
                      'total_odd'   => 'under 36½ -110',
                      'odd_type'    => 'total_odd',
                      'period'      => 'Game' );

$game_data[] = array( 'sport_type'  => 'Football',
                      'game_number' => 102,
                      'game_name'   => 'Pittsburgh Steelers',
                      'runline_odd' => '-9 -120',
                      'total_odd'   => '',
                      'odd_type'    => 'runline',
                      'period'      => '1st Half' );

0 Cevap