RE: [PHP] strip php tags from code ?

2003-01-12 Thread Timothy Hitchens \(HiTCHO\)
So you want to remove only the unparsed/raw php script blocks.

Why... are you displaying PHP without parsing??

If this is the case you can write a couple of very simple preg_replace
with a call
back and all is done.



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -Original Message-
> From: David D [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, 6 January 2003 10:48 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] strip php tags from code ?
> 
> 
> I only want to keep html code of a page.
> I want to remove php tags.
> Some tell that strip_tags is not adapted.
> 
> sample of what i want to do:
> 
> na
> 
> 
> ->
> 
> na
> 
> 
> php tags can be :
> or 
> or   /i
> 
> Merci.
> 
> 
> 
> ..
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] strip php tags from code ?

2003-01-12 Thread Matt
>- Original Message -
>From: "David D" <[EMAIL PROTECTED]>
>Sent: Monday, January 06, 2003 7:47 AM
>Subject: [PHP] strip php tags from code ?


> I only want to keep html code of a page.
> I want to remove php tags.

It sound like you want the parser output of the page.  You can use PHPs
output control to buffer the page output, and capture it into a variable to
do whatever you want with it.

http://www.php.net/manual/en/ref.outcontrol.php

Alternately, you can find a template class that does it.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] strip php tags from code ?

2003-01-12 Thread David D
I only want to keep html code of a page.
I want to remove php tags.
Some tell that strip_tags is not adapted.

sample of what i want to do:

na


->

na


php tags can be :
or 
or   /i

Merci.



.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Strip PHP tags

2002-08-12 Thread Justin French

The only NATIVE way is using strip_tags(), and physically allowing most HTML
tags to be included:


$allowed = 
"

Re: [PHP] Strip PHP tags

2002-08-12 Thread James Green

On Mon, 2002-08-12 at 18:35, Remy Dufour wrote:
> Hi all,
> 
> Is there an easy way to remove  tag from a string ?
> Ive got this script and i want it to output only html...
> I know i can do this with regular expression but i wonder if there are some
> native function to do the job.

http://uk.php.net/manual/en/function.strip-tags.php

James



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Strip PHP tags

2002-08-12 Thread Remy Dufour

Hi all,

Is there an easy way to remove  tag from a string ?
Ive got this script and i want it to output only html...
I know i can do this with regular expression but i wonder if there are some
native function to do the job.




Test



Hello !!!



Regards !

Rémy Dufour


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php