Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8559077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:57:22+00:00 2026-06-11T15:57:22+00:00

Here is my source $Message = $_GET[message]; $Username = htmlspecialchars($_GET[username]); $unix = ($_GET[time]); include

  • 0

Here is my source

 $Message = $_GET["message"];
 $Username = htmlspecialchars($_GET["username"]);
 $unix = ($_GET["time"]);
 include 'mcheck.php'; 
$file1 = file_get_contents('filter.txt');
$bad_words = explode(PHP_EOL, $file1);
$compare = explode('', $Message);
foreach ($bad_words as $bad_word)
  $Message = preg_replace('/\b('.$bad_word.')\b/i', "***", $Message);
  echo $Message;

Say the bad word is go

and $Message = I Like to go to school

I want it to echo I Like to *** to school

but instead im getting

***I***Like***To******to***school***

i dont know what the problem is

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:57:24+00:00Added an answer on June 11, 2026 at 3:57 pm

    Your file most likely ends with a newline (which is a good thing: all text-files on *nix systems are supposed to), which means that the last element of explode(PHP_EOL, $file1) is empty (it’s everything between the last newline and the end of the file, which is nothing). I would recommend writing:

    $file1 = trim(file_get_contents('filter.txt'));
    

    using the trim function to eliminate that last newline.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all. I've downloaded and moved the Xerces (v3.1.1) source here: /usr/include/xerces and I
Here is my source code: FB.ui({method: 'apprequests', to: fbId, message: hello}, function(resp){ if(resp.request_ids){ $('#req-id').val(resp.request_ids);
I'm trying to perform a skew on an image, like one shown here (source:
Here is source code: @OneToOne(fetch = FetchType.LAZY) @Cascade({SAVE_UPDATE, EVICT, DELETE}) @JoinColumn(name = A_ID, nullable
Edit: You can get the full source here: http://pastebin.com/m26693 Edit again: I added some
To see what I mean, check out my source here in IE. When you
var _thumb = $('.galleria img[@rel='+_src+']'); Full source here Is it a deprecated selector?
Here is the source Table . I want to retrieve the Name , Host
Here is the source xml: xml This is the xml of an fxg file
you can view full source code here dpaste.com/hold/167199 Error: delete() takes exactly 2 arguments

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.