我想导入这个:
http://en.wikipedia.org/wiki/List_of_countries_by_continent_%28data_file%29
其格式如下:
AS AF AFG 004 Afghanistan, Islamic Republic of
EU AX ALA 248 Åland Islands
EU AL ALB 008 Albania, Republic of
AF DZ DZA 012 Algeria, People's Democratic Republic of
OC AS ASM 016 American Samoa
EU AD AND 020 Andorra, Principality of
AF AO AGO 024 Angola, Republic of
NA AI AIA 660 Anguilla
Run Code Online (Sandbox Code Playgroud)
如果我做
<? explode(" ",$data"); ?>
Run Code Online (Sandbox Code Playgroud)
除了超过1个单词的国家之外,它的工作正常.
我怎么能拆分它所以我得到前4位数据(字符/整数)和第5位数据是剩下的?
这是在PHP
谢谢