php 正则求解
<div class="line"><ul id="list" class="cent" style="list-style:none;"><br /><li><span class="code">A</span><a href="http://www.ztflh.com/?c=2">XXX、敏感词、敏感词、敏感词</a></li><li><span class="code">B</span><a href="http://www.ztflh.com/?c=141">哲学、宗教</a></li><li><span class="code">C</span><a href="http://www.ztflh.com/?c=896">社会科学总论</a></li><li><span class="code">D</span><a href="http://www.ztflh.com/?c=1110">政治、法律</a></li><li><span class="code">E</span><a href="http://www.ztflh.com/?c=2235">军事</a></li><li><span class="code">F</span><a href="http://www.ztflh.com/?c=2666">经济</a></li><li><span class="code">G</span><a href="http://www.ztflh.com/?c=4237">文化、科学、教育、体育</a></li><li><span class="code">H</span><a href="http://www.ztflh.com/?c=5668">语言、文字</a></li><li><span class="code">I</span><a href="http://www.ztflh.com/?c=6191">文学</a></li><li><span class="code">J</span><a href="http://www.ztflh.com/?c=6495">艺术</a></li><li><span class="code">K</span><a href="http://www.ztflh.com/?c=7464">历史、地理</a></li><li><span class="code">N</span><a href="http://www.ztflh.com/?c=9484">自然科学总论</a></li><li><span class="code">O</span><a href="http://www.ztflh.com/?c=9580">数理科学和化学</a></li><li><span class="code">P</span><a href="http://www.ztflh.com/?c=11634">天文学、地球科学</a></li><li><span class="code">Q</span><a href="http://www.ztflh.com/?c=13945">生物科学</a></li><li><span class="code">R</span><a href="http://www.ztflh.com/?c=17417">医药、卫生</a></li><li><span class="code">S</span><a href="http://www.ztflh.com/?c=21152">农业科学</a></li><li><span class="code">T</span><a href="http://www.ztflh.com/?c=25844">工业技术</a></li><li><span class="code">U</span><a href="http://www.ztflh.com/?c=40585">交通运输</a></li><li><span class="code">V</span><a href="http://www.ztflh.com/?c=44097">航空、航天</a></li><li><span class="code">X</span><a href="http://www.ztflh.com/?c=45419">环境科学、安全科学</a></li><li><span class="code">Z</span><a href="http://www.ztflh.com/?c=45735">综合性图书</a></li></ul><br /></div>
想要得到span里的内容,还有的链接与内容,不知道应该怎么写这个正则,试了好久,好多种,都拿不到。没办法了,上论坛求高人帮助。
已经用substr的办法提到数据了,但还是很想知道正则应该如何写,可以直接提成一个数组,这样比substr 更好多了。求解。
------解决方案--------------------
$s=<div> <ul> <br><li> <span>A</span><a>XXX、敏感词、敏感词、敏感词</a> </li> <li> <span>B</span><a>哲学、宗教</a> </li> <li> <span>C</span><a>社会科学总论</a> </li> <li> <span>D</span><a>政治、法律</a> </li> <li> <span>E</span><a>军事</a> </li> <li> <span>F</span><a>经济</a> </li> <li> <span>G</span><a>文化、科学、教育、体育</a> </li> <li> <span>H</span><a>语言、文字</a> </li> <li> <span>I</span><a>文学</a> </li> <li> <span>J</span><a>艺术</a> </li> <li> <span>K</span><a>历史、地理</a> </li> <li> <span>N</span><a>自然科学总论</a> </li> <li> <span>O</span><a>数理科学和化学</a> </li> <li> <span>P</span><a>天文学、地球科学</a> </li> <li> <span>Q</span><a>生物科学</a> </li> <li> <span>R</span><a>医药、卫生</a> </li> <li> <span>S</span><a>农业科学</a> </li> <li> <span>T</span><a>工业技术</a> </li> <li> <span>U</span><a>交通运输</a> </li> <li> <span>V</span><a>航空、航天</a> </li> <li> <span>X</span><a>环境科学、安全科学</a> </li> <li> <span>Z</span><a>综合性图书</a> </li> </ul> <div class="clear"> </div> </div>

ThesecrettokeepingaPHP-poweredwebsiterunningsmoothlyunderheavyloadinvolvesseveralkeystrategies:1)ImplementopcodecachingwithOPcachetoreducescriptexecutiontime,2)UsedatabasequerycachingwithRedistolessendatabaseload,3)LeverageCDNslikeCloudflareforservin

You should care about DependencyInjection(DI) because it makes your code clearer and easier to maintain. 1) DI makes it more modular by decoupling classes, 2) improves the convenience of testing and code flexibility, 3) Use DI containers to manage complex dependencies, but pay attention to performance impact and circular dependencies, 4) The best practice is to rely on abstract interfaces to achieve loose coupling.

Yes,optimizingaPHPapplicationispossibleandessential.1)ImplementcachingusingAPCutoreducedatabaseload.2)Optimizedatabaseswithindexing,efficientqueries,andconnectionpooling.3)Enhancecodewithbuilt-infunctions,avoidingglobalvariables,andusingopcodecaching

ThekeystrategiestosignificantlyboostPHPapplicationperformanceare:1)UseopcodecachinglikeOPcachetoreduceexecutiontime,2)Optimizedatabaseinteractionswithpreparedstatementsandproperindexing,3)ConfigurewebserverslikeNginxwithPHP-FPMforbetterperformance,4)

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
