【发布时间】:2014-05-18 11:58:18
【问题描述】:
我正在尝试在破折号之前返回我的标题中的所有内容,这是我的代码
$mystring = "Nymphomaniac: Volume 1 – Nimfomana Vol. I (2013) – filme online";
$mystring = str_replace(' ', '+', $mystring);
$mystring = str_replace('-', '(/', $mystring);
$parts1 = explode("(", $mystring);
//break the string up around the "(" character in $mystring
$mystrings = $parts1[0];
echo $mystrings;
输出是这样的
Output:
Nymphomaniac:+Volume+1+–+Nimfomana+Vol.+I+
我想要的是这个
Output:
Nymphomaniac:+Volume+1
我认为问题在于有 2 个破折号我已经尝试了所有方法但没有成功,感谢您的帮助
【问题讨论】: