🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #230460

Re: nie wychodzi mi preg replace

#230460
From: Leszek Zur
Date: Thu, 26 Jun 2014 20:28
13 lines
1531 bytes
W dniu 2014-06-26 21:41, zlotowinfo pisze:
> preg_replace("/[^?@!A-Za-z0-9ęóąśłżźćńĘÓĄŚŁŻŹĆŃęó??łżĽćńĘÓˇ|ŁŻ?ĆŃ., '"-]/",
> "", $pytanie);

PHP Parse error:  syntax error, unexpected ']' in ...

Powinno być:
preg_replace("/[^?@!A-Za-z0-9ęóąśłżźćńĘÓĄŚŁŻŹĆŃęó??łżĽćńĘÓˇ|ŁŻ?ĆŃ., 
'\"-]/","", $pytanie);

Zapomniałeś o znaku \ przed "

Leszek
Technical Details
Message-ID: <lohvqi$sqg$1@news.vectranet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin2!goblin.stu.neva.ru!xlned.com!feeder3.xlned.com!newsreader4.netcologne.de!news.netcologne.de!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!news.vectranet.pl!.POSTED!not-for-mail
References: <loht0j$vv3$1@node2.news.atman.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin2!goblin.stu.neva.ru!xlned.com!feeder3.xlned.com!newsreader4.netcologne.de!news.netcologne.de!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!news.vectranet.pl!.POSTED!not-for-mail
From: Leszek Zur <USUNTO.leszek@teczowe.eu.org>
Newsgroups: pl.comp.lang.php
Subject: Re: nie wychodzi mi preg replace
Date: Thu, 26 Jun 2014 22:28:58 +0200
Organization: Vectra - http://www.vectra.pl
Lines: 14
Message-ID: <lohvqi$sqg$1@news.vectranet.pl>
References: <loht0j$vv3$1@node2.news.atman.pl>
NNTP-Posting-Host: 078088121201.dzierzoniow.vectranet.pl
Mime-Version: 1.0
X-Trace: news.vectranet.pl 1403814546 29520 78.88.121.201 (26 Jun 2014 20:29:06 GMT)
X-Complaints-To: usenet@news.vectranet.pl
NNTP-Posting-Date: Thu, 26 Jun 2014 20:29:06 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To: <loht0j$vv3$1@node2.news.atman.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit