我已经在这几个小时......任何帮助将不胜感激。
我想preg_match_all
在字符串之间,“ Level:
”和“ <HR>
”
一切正常,除非我添加了这封信h
为什么?!?
<?php
include("courses.php");
preg_match_all('/(level:.*?)r>/i', $str, $matches);
// this works but picks up <br>, so i wanted to add in the letter h
preg_match_all('/(level:.*?)h/i', $str, $matches);
// i've tried changing it to `hr` but that fails, now, *even only* `h` fails
print_r($matches[1]);
?>
我试过转义 h,但不知道这封信有什么问题。
字符串是:
$str='Level: <B>Undergraduate</B><BR>
Information Literacy Course: <B>N</B><BR>
Special Restriction: <B>None</B><BR>
<HR>';
// this repeats alot. I just wrote it out once, but it's all in the same variable like this.
我想你们问我要那根绳子,点亮了我脑海中的灯泡。我没有考虑换行吗?