Home  >  Article  >  Backend Development  >  How to implement php ereg() to convert htm to xml file_PHP tutorial

How to implement php ereg() to convert htm to xml file_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:02:49942browse

php tutorial ereg() how to convert htm to xml file

Syntax: int ereg(string pattern, string string, array [regs]);

Return value: integer/array

$text = "

This is some text here "

".

";
ereg("

(([^<"]|[^<]*<[^/][^<])*("[^"]*"([^<"]|[^< ;]*<[^/][^<])*)*)?

", $text, $matches);
echo "Found text: " . $matches[1] . "n";
?>

Content Description


This function uses pattern rules to parse and compare string strings. The value returned by the comparison result is placed in the array parameter regs. The content of regs[0] is the original string, regs[1] is the first string that conforms to the rules, and regs[2] is the second string that conforms to the rules. string, and so on. If the parameter regs is omitted, it will simply be compared, and the return value will be true if found.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445344.htmlTechArticlephp tutorial ereg() converts htm to xml file implementation method syntax: int ereg(string pattern, string string, array [regs]); Return value: integer/array$text = This is some text here. ; ereg...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn