我HABE用PHP 5.3和Joomla和錯誤顯示這樣 的preg_replace(一個問題)[ 'W' 在/ var/WWW/的preg_replace()[function.preg替換]:未知的修飾 'W' 中/var/www/.../public_html/
我的代碼
$params = $this->item->params;
$images = json_decode($this->item->images);
$urls = json_decode($this->item->urls);
$canEdit = $this->item->params->get('access-edit');
$user = JFactory::getUser();
$imagesJson = json_decode($this->item->images);
$images_stringPath = substr($imagesJson->image_fulltext, 0,strripos($imagesJson->image_fulltext, '/'));
$path = "/".$images_stringPath;
$tmp_filename=preg_replace($_SERVER["DOCUMENT_ROOT"].$path.'/','',$value);
爲什麼不使用'str_replace'? – Gumbo 2013-05-05 07:07:09