Article View: pl.comp.lang.php
Article #231218FCKeditor i buforowanie ob_start, ob_get_contents
From: web
Date: Thu, 28 Jan 2016 10:51
Date: Thu, 28 Jan 2016 10:51
43 lines
2194 bytes
2194 bytes
walczę z fckeditor. Przed PHP 5.3 działało dobrze, później przestało.
Wreszcie doszedłem, że przyczyna jest nieodpowiednie zachowanie buforowania ob_start(), ob_get_contents().
poniżej kod, który sprawia problemy
-----------------------------
ob_start();
include("plik.txt");
$content = ob_get_contents();
ob_end_clean();
$oFCKeditor = new FCKeditor('EDYTOR') ;
$oFCKeditor->BasePath = 'fckeditor/' ;
$oFCKeditor->Height = '300' ;
$oFCKeditor->width = '98%' ;
$oFCKeditor->Value = $content ;
$oFCKeditor->Create() ;
------------------------------------
w PHP 5.3 i późniejsze do $content nie chce wchodzić include(readfile tez nie, require też nie)
natomiast takie wyrazenie:
-------------------------
ob_start();
echo "cos tam";
// include("plik.txt");
$content = ob_get_contents();
ob_end_clean();
------------------------
powoduje, ze "coś tam" pojawia się w $content.
PYTANIE!
Jak za pomocą include lub podobnej funkcji wrzucić zawartość pliku do $content, czyli ostatecznie wyświetlić w FCKEditor
z góry pieknie dziekuje za pomoc
Technical Details
Message-ID:
<10a855bb-386c-4caa-8ebb-3880375a0cfd@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.glorb.com!o2no6980538iga.0!news-out.google.com!l1ni10268igd.0!nntp.google.com!h5no10554909igh.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
X-Received: by 10.66.55.4 with SMTP id n4mr1981845pap.20.1453978287559; Thu, 28 Jan 2016 02:51:27 -0800 (PST) X-Received: by 10.50.60.5 with SMTP id d5mr28117igr.7.1453978287525; Thu, 28 Jan 2016 02:51:27 -0800 (PST) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.glorb.com!o2no6980538iga.0!news-out.google.com!l1ni10268igd.0!nntp.google.com!h5no10554909igh.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: pl.comp.lang.php Date: Thu, 28 Jan 2016 02:51:27 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=81.15.177.178; posting-account=R6oO1AoAAABfrNSrWO96fWl4VkA_YMU8 NNTP-Posting-Host: 81.15.177.178 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <10a855bb-386c-4caa-8ebb-3880375a0cfd@googlegroups.com> Subject: FCKeditor i buforowanie ob_start, ob_get_contents From: web <mirekgutowski@gmail.com> Injection-Date: Thu, 28 Jan 2016 10:51:27 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit