Re: cvs: pear /Text_Wiki/doc BBtest.txt test_Text_Wiki.php

From: Date: Tue, 19 Jul 2005 09:18:55 +0000
Subject: Re: cvs: pear /Text_Wiki/doc BBtest.txt test_Text_Wiki.php
References: 1 2 3  Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-33138@lists.php.net to get a copy of this message
On Mon Jul 18, 2005 at 08:3149PM +0200, bertrand Gugger wrote: > Martin Jansen wrote: > >On Mon Jul 18, 2005 at 04:3552PM -0000, bertrand GUGGER wrote: > >>+if ($_SERVER['PHP_SELF']) { > >>+ $html = true; > > > >Why don't you check for the return value of php_sapi_name() instead? > > > I'm really not sure it's an easy/correct way ... > How decrypt that in the list of possible sapi_names ? I'd suggest something like the following: <?php $html = true; if (php_sapi_name() == "cli") { $html = false; } ?> This of course does not cover exotics such as the embed or activescript SAPIs, but it should suffice for your needs. - Martin

« previous php.pear.cvs (#33138) next »