vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Anyone have a html stripper in php? (https://vborg.vbsupport.ru/showthread.php?t=46591)

joor 12-11-2002 11:40 PM

Anyone have a html stripper in php?
 
I am looking for a regular expressions function that will strip the html when I pass a variable through it. I have one for asp, but I am just making my move over to php and google has not turned one up. Just hoping that someone may have one laying around. TIA

DrkFusion 12-12-2002 07:24 PM

Strip?

Xenon 12-12-2002 07:25 PM

hmm, are you talking bout the htmlspecialchars function?

Logician 12-19-2002 11:16 AM

PHP Code:

$string strip_tags($string); 


Dean C 12-19-2002 11:41 AM

I had a look at what "strip_tags" does and i don't quite understand..

If you assign a variable which is html does it strip the html from the variable?

- miSt

Dean C 12-19-2002 11:41 AM

So would this work?

PHP Code:

$mist = <b>Mist</b>
$mist strip_tags($mist); 


nsr81 12-19-2002 11:55 AM

No, but this will :D

PHP Code:

$mist "<b>Mist</b>";
$mist strip_tags($mist); 


Dean C 12-19-2002 11:59 AM

ahhh but why the quotes?

I was once told quotes aren't needed when assigning a variable?

- miSt

Velocd 12-19-2002 12:52 PM

Quotes are needed in variables that contain strings which include spaces in them, characters such as the exclamation mark that could conflict with code syntax, or HTML, javascript, etc.

Will work:
PHP Code:

$string "hello world";

or

$string helloworld;

or

$string 12342342345345

Wont work:
PHP Code:

$string hello world;

or

$string 32423 234234;

or

$string = <b>helloworld</b>;

or

$string helloworld!!!; 


Dean C 12-19-2002 01:34 PM

ahhh thanks for explaining it to me :)!

- miSt


All times are GMT. The time now is 01:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00980 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete