Related Content
Generating Histogram Colour Analysis Graphs From Images In PHP
If you've ever looked at the settings in a digital camera, or have experience with image processing programs like GIMP, then you may have seen a colour histogram. This is a simple graph that shows the amount of different shades of colour are present in the image.
PHP:CSI - To Switch, Or Not To Switch?
I was writing unit tests for a API mapping function recently and came across this interesting issue. The code I was writing tests for was in a legacy codebase that I was making changes to, and it made sense to have some unit tests in there before I started work to ensure everything worked before and after.
Drupal 9: Generating Header Images For Pages Of Content Using PHP
Embedding image within pages of content helps both within the design of the page and when shared on social media. If you set up meta tags to point at a particular image then that image will appear when the page is shared on social media. This makes your page stand out more.
Using PSR-4 With Composer
The PHP Standards Recommendations (called PSR) are a set of standards that aim to make certain aspects of working with PHP easier.
Generating A PDF From A Web Page Using PHP And Chrome
Generating a PDF document from a web page through PHP can be problematic. It's often something that seems quite simple, but actually generating the document can be difficult and time consuming.
PHP:CSI - Date Is Less Than One Month Ago
Working with logic surrounding dates can sometimes be difficult and it's fairly common to come across really subtle date and time based bugs.
I was recently shown a bug in a PHP application that looks like it should be working at face value, but doesn't actually produce the correct result.
Comments
Submitted by Anonymous on Tue, 07/06/2010 - 02:24
PermalinkSubmitted by philipnorton42 on Tue, 07/06/2010 - 08:55
PermalinkHey, really nice script, I can tell you've taken your time on it.
I was dealing with a word dictionary called badwords.txt I found on Google Code which had some words in like 's***'. The played havok with your script until I escaped the charachters:
$text = preg_replace('/\b'.preg_quote($filterWords[$i]).'\b/ie',"str_repeat('*',strlen('$0'))",$text);
I agree, WebPurify is a step too far.
Submitted by Michael Rich on Mon, 12/05/2011 - 03:04
PermalinkThanks for the tip Michael :)
Submitted by philipnorton42 on Mon, 12/05/2011 - 09:09
PermalinkSubmitted by steve17 on Fri, 04/25/2014 - 12:12
PermalinkSubmitted by Jim on Tue, 06/07/2016 - 17:56
PermalinkSubmitted by hashbanganon on Sun, 03/05/2017 - 08:28
PermalinkSubmitted by mike on Thu, 03/15/2018 - 21:07
Permalinkanyone get this to work with preg_replace_callback for php 7?
Submitted by nick on Thu, 04/16/2020 - 20:27
PermalinkAdd new comment