伙计们,我正在建立一个足球博彩网站,数据馈送公司在一个单独的列中为我提供主队和客队,以 - 符号分隔。我试图思考它,但变得更加困惑,这就是我所拥有的:
$query = "SELECT * FROM participant_template";
$result = mysql_query($query);
if($result){
while($row = mysql_fetch_array($result)){
$teams = $row['teams'];
// The output of $teams looks like this: Manchester - Chelsea
$home_team = "Please help me out";
$away_team = "Please help me out";
}
}
我如何将它们分为主队和客队。