vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Replacing words problem (https://vborg.vbsupport.ru/showthread.php?t=50113)

007 03-13-2003 08:50 PM

Replacing words problem
 
I am trying to make something that replaces certain words:

I tried:

PHP Code:

$bbcode=strtolower(str_replace(trim("word"),"replacementword",$bbcode)); 

The reason the strtolower was in case somebody uses "wOrd" or "WORd" etc. But the problem is now every message is in lowercase.

Is there another way to do this?

I then tried:

PHP Code:

  if ($bbcode == strt("word")) {
    
$bbcode strtolower("replacementword");
  } 

Something about that brought up the dreaded white error page.

What am I doing wrong? Or is there another way to do this? Thanks.

amykhar 03-13-2003 08:53 PM

Try this:

Code:

$bbcode=str_replace(trim("word"),"replacementword",strtolower($bbcode));

mr e 03-13-2003 09:20 PM

strt isn't a php function

007 03-13-2003 09:23 PM

*sighs*

Ooops, I did use str (which is a PHP funciton) but typed it wrong up there. Sorry. :speechless:

And Amy, that still didn't work, now every post is entirely in lowercase still... :ermm:

amykhar 03-15-2003 01:05 PM

006, I got it.

See the text file here:

https://vborg.vbsupport.ru/showthrea...threadid=50116

It has the function you need called stri_replace.

Funny the things google can find for you :D

Amy

007 03-15-2003 08:03 PM

Oh, :) I saw that but I had already fixed it. I searched around here at VBorg and found it. Amazing what searching here can do for you too :) Thanks.

;)


All times are GMT. The time now is 10:05 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.00976 seconds
  • Memory Usage 1,723KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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