请PHP老师,帮忙写段代码.非常感谢!该怎么处理
请PHP老师,帮忙写段代码.非常感谢!!
HtmlString = "……var pictree = ['1341972991328.html','1341972991534.html','1341972991731.html','1341972991929.html','1341972992128.html','1341972992341.html','1341972992586.html','1341972992780.html','1341972992972.html','1341972993169.html','1341972993363.html','1341972993560.html','1341972993749.html','1341972993955.html','1341972994153.html'];
//-->
……"
字符串变量HtmlString。变量值不确定。但都存在 var pictree = [字符串1] 和 。
如何把 字符串1 里各''里的内容和 字符串2 连接起来组成一个新的字符串?
在线等。 第一次接触PHP。谢谢老师!!
------解决方案--------------------
- PHP code
$HtmlString = <input type="hidden" name="thePage" id="thePage" value="1"> <input type="hidden" name="thePath" id="thePath" value="080819/hyrz008081909/1341972991328/"> <input type="hidden" name="maxPage" id="maxPage" value="15"> html; preg_replace('/var pictree = \[([^\]]*)\]/e',"\$s='$1'",$HtmlString); $arr=explode(',',str_replace("'",'',$s)); $str=preg_match('/id="thePath" value="(.*?)"/s',$HtmlString,$m); foreach($arr as &$v) $v=$m[1].$v ; print_r($arr); <br><font color="#e78608">------解决方案--------------------</font><br>
- PHP code
$HtmlString = <input type="hidden" name="thePage" id="thePage" value="1"> <input type="hidden" name="thePath" id="thePath" value="080819/hyrz008081909/1341972991328/"> <input type="hidden" name="maxPage" id="maxPage" value="15">……" HTML; preg_match('/pictree\s=\s\[(.*)\].*id="thePath"\svalue="([a-z\d\/]+)"/is', $HtmlString, $match); if (isset($match[1]) && isset($match[2])) echo $match[1] . $match[2]; <div class="clear"> </div>

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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.
