Censoring messages in PHP PHP script

SPONSORED LINKS

    Specification

  • Version:
  • File size: 0 KB
  • File name: id=1006
  • Last update:
  • Platform: Windows / Linux / BSD / Solaris
  • Language: PHP
  • Price:Freeware
  • Company: saifullah shafiq (View more)

Censoring messages in PHP script description:




Publisher review:
Censoring messages in PHP shows how to hide email addresses in your messages. Consider that you place a messaging system on your site from where users of your site can communicate wit site froher. This would really increase hits on your site but what if users give each other their email address in the message then they wont need your messaging system, hence they wont be coming to your site. So you need to censor out any email address in the messages that users send to each other. I came up with an efficient yet simple solution to this problem. All you have to do is to search for any '@' in the message and then censor out few characters that appear after it and before it. For example, if you type "myemailaddress@hotmail.com" then the script will display it like my*********com. Here is the how it works For Example we got the following message: $message = "hello this is my email address: myaddress@mydomain.com" 1. First you search for '@' in the message that is passed to the function. strrpos returns the position of the character you specify. $emailpos = strrpos($message,'@'); This line will return the value '42'. 2. Then we check if there was a '@' in the message if none then we simply return the passed message other wise we proceed to the next step. 3. Then we take out the sub string (email address) based on the position we got from above. For Example, if we got the following message. $email = substr($message,$emailpos-5,12 ); Here we start the sub string by first going back 5 characters and then taking out next 12 characters. This will return 'dress@mydoma' you can change the length by changing values in the above function. I only used 12 characters because i think that is sufficient. You can change this according to your needs. 4. Then in the final step we simplly need to replace this substring (email address) with anything we like. Iprefer using '******'. You can use whatever you want. $message =eregi_replace($email,"********",$message); 5. Thats it! Now you just return the censored $message.
Censoring messages in PHP is a PHP script for Snippets scripts design by saifullah shafiq. It runs on following operating system: Windows / Linux / BSD / Solaris.

Operating system:
Windows / Linux / BSD / Solaris

Latest script and internet news

The new Firefox 37 comes with improved HTTP / 2 and superior HMTL5 compatibility with YouTube

The new Firefox 37 comes with improved HTTP / 2 and superior HMTL5 compatibility with YouTube

The popular browser Firefox reached version 37, bringing a series of news but not as significant as other versions.

Posted on: 03 Apr 2015 11:11 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Google Chrome version 42 comes with implementation of interesting options for software developers who want to turn their websites into complex Web applications: Push notification system which is permanently active.

Posted on: 17 Mar 2015 07:57 by A. Brown

Gamers, Microsoft presents the advantages of DirectX 12 and 11.3 platforms used by new games for Windows 10

Gamers, Microsoft presents the advantages  of DirectX 12 and 11.3 platforms used by new games for Windows 10

The Windows 10 preview event brought also to the attention of gamers a demonstration of the advantages of the new DirectX 12 API by Microsoft, which announced several technologies providing integration with Xbox One game consoles.

Posted on: 27 Jan 2015 09:15 by A. Brown

Android devices now have access to Google Chrome 40

Android devices now have access to Google Chrome 40

Finally was officially released version 40 of Chrome browser for Android devices, iOS and Windows PCs, coming up with an interesting range of bug fixes and optimizations.

Posted on: 23 Jan 2015 13:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 0.0 out of 5
Based on 0 ratings. 0 user reviews.

  • Currently 0.00 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5