php-windows Digest 10 Dec 2004 12:35:04 -0000 Issue 2501
Topics (messages 25138 through 25142):
Re: fopen and ftp, help please
25138 by: Luis Moreira
Presenting code snipetts in standard PHP colours
25139 by: Ross Honniball
25140 by: Tony Devlin
Re: Presenting code snipetts in standard PHP colours -THANKS
25141 by: Ross Honniball
Absolute includes
25142 by: S.D.Price
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Do you close the file after using it ?
If not, it may get stuck.
Luis
Iker Landajuela wrote:
Hi, I�m newbie in PHP programming.
Iit�s about opening files in an
ftp with php, I have the same problem like you, mi script opens the file
correctly the first time but no longer, what`s the problem?
Thanks.
if(!($filehandle=fopen("ftp://user:[EMAIL PROTECTED]/html/BIOCAB/".$CFG['Fi
leLogTrace'],"a"))) {
--- End Message ---
--- Begin Message ---
Hi all,
What is the easiest way to get a web page to list source code with standard
colour high-lighting (as used in my php_manual_el.CHM file and as you see
on various php web pages about the place).
Is there a class or a function or something that anyone knows of?
Thanks ... Ross
.
. Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
.
--- End Message ---
--- Begin Message ---
PHP's website (http://www.php.net) has a great solution to displaying source
code. If you view the source code on their site you can see how they do it.
It's just a basic function to loop through the text and place in code to
highlight in various places. In fact here is that portion of code:
function highlight_php($code, $return = FALSE)
{
// Using OB, as highlight_string() only supports
// returning the result from 4.2.0
ob_start();
highlight_string($code);
$highlighted = ob_get_contents();
ob_end_clean();
// This should eventually be a php_syntax_check() call when we move to
PHP5
// But use this ugly hack for now to avoid code snippets with bad syntax
screwing up the highlighter
if(strstr($highlighted,"include/layout.inc</b>")) $highlighted =
"<pre>".htmlentities($code)."</pre>";
// Fix output to use CSS classes and wrap well
$highlighted = '<div class="phpcode">' . str_replace(
array(
' ',
'<br />',
'<font color="', // for PHP 4
'<span style="color: ', // from PHP 5.0.0RC1
'</font>',
"\n ",
' '
),
array(
' ',
"<br />\n",
'<span class="',
'<span class="',
'</span>',
"\n ",
' '
),
$highlighted
) . '</div>';
if ($return) { return $highlighted; }
else { echo $highlighted; }
}
This is how they called that function:
highlight_php(join("", file($page_name)));
Original Message-----
From: Ross Honniball [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 09, 2004 6:42 AM
To: php windows
Subject: [PHP-WIN] Presenting code snipetts in standard PHP colours
Hi all,
What is the easiest way to get a web page to list source code with standard
colour high-lighting (as used in my php_manual_el.CHM file and as you see
on various php web pages about the place).
Is there a class or a function or something that anyone knows of?
Thanks ... Ross
.
. Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Thank you to all who replied to my question. The perfect solution for me
was the highlight_string function. Bril.
Thanks again ... Ross.
X-Originating-IP: [210.213.222.149]
X-Originating-Email: [EMAIL PROTECTED]
X-Sender: [EMAIL PROTECTED]
From: "OJ Tibi" <[EMAIL PROTECTED]>
To: "Ross Honniball" <[EMAIL PROTECTED]>
Subject: Re: [PHP-WIN] Presenting code snipetts in standard PHP colours
Date: Thu, 9 Dec 2004 21:36:10 +0800
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-OriginalArrivalTime: 09 Dec 2004 13:37:02.0025 (UTC)
FILETIME=[2A09A390:01C4DDF4]
http://ph.php.net/manual/en/function.highlight-string.php
Take your night life to the next level!
Visit http://www.mymetroguide.com/ today!
MyMetroGuide.com, the hippest and coolest night life community in the
Philippines!
----- Original Message ----- From: "Ross Honniball" <[EMAIL PROTECTED]>
To: "php windows" <[EMAIL PROTECTED]>
Sent: Thursday, December 09, 2004 7:42 PM
Subject: [PHP-WIN] Presenting code snipetts in standard PHP colours
Hi all,
What is the easiest way to get a web page to list source code with
standard colour high-lighting (as used in my php_manual_el.CHM file and
as you see on various php web pages about the place).
Is there a class or a function or something that anyone knows of?
Thanks ... Ross
.
. Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
.
. Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
.
--- End Message ---
--- Begin Message ---
Hi, can anyone help me out. What would I need to do to use an absolute
php includes to include this file in
1. Windows 2000 - IIS
2. Unix linux - Apache
: <!--#include virtual="/wwwcommon/site/test.htm" -->
Thanks
Steven
--- End Message ---