안녕하세요 난이 난 테이블에 머리를 두드리는 후 10 배문제
preg_match_all("#>\w*#",$data,$result);
이 반환 아래 정규 표현식을 사용하여 알아 낸
<option value="http://www.torontoairportlimoflatrate.com/aurora-limousine-service.html">Aurora</option> <option value="http://www.torontoairportlimoflatrate.com/alexandria-limousine-service.html">Alexandria</option>
아래 형식의 데이터 결과는 아래와 같습니다
Array
(
[0] => Array
(
[0] => >Ajax
[1] => >
[2] => >Aurora
[3] => >
[4] => >Alexandria
[5] => >
[6] => >Alliston
나는 오직 하나의 배열을 원한다 havin g 값 즉 도시 [0] => Ajax [>] 오로라 ...... 등등.
탄원
정규식을 사용하지 마십시오. HTML 파서를 사용하십시오. [HTML을 구문 분석하는 데 가장 좋은 방법] (http://stackoverflow.com/questions/3577641/best-methods-to-parse-html) –
이것은 [HTML Parser] (http://stackoverflow.com)의 작업입니다./questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454 # 1732454) –