如何從一組問題與正則表達式中提取的問題,選擇和答案如何使用正則表達式提取文本?
例如:
1. An FMS system, besides controlling navigation, thrust and auto-nav,
also provides:
a) take-off and landing warnings
* b) dedicated status and warnings
c) GPWS warnings
2. EADI sky and ground display is provided by:
a) synthetic TV signals
* b) raster scan
c) stroke pulse
我需要的輸出是這樣的:
$question[0] = "An FMS system, besides controlling navigation, thrust and auto-nav,also provides:";
$choice1[0] = "take-off and landing warnings";
$choice2[0] = "dedicated status and warnings";
$choice3[0] = "GPWS warnings";
$question[1] = "EADI sky and ground display is provided by:";
$choice1[1] = "synthetic TV signals";
$choice2[1] = "raster scan";
$choice3[1] = "stroke pulse";
的*
號表示回答 什麼模式應該我寫 非常感謝
我覺得這樣做可以通過按行分割和檢查前幾個字符來更好地完成。 –
我想單獨選擇問題並將它們保存到數據庫中 –
那麼,到目前爲止您嘗試過了什麼?你在哪裏碰到路障?否則,您可以聘請自由職業者爲您提供一些代碼,並且很樂意應用您稍後想出的任何更改。 – hakre