Jump to content

Referencing literals


bgsomers

Recommended Posts

I have a routine that scans guest-book entries for objectionable words or terms, using the function strpos:

 

if strpos($entry, 'word1') == TRUE

or strpos($entry, 'word2') == TRUE

...

 

I want to create "strposplus", which will use strpos in this way, but when a word is found, will write that word to a file, along with the entry itself.

 

if strposplus($entry, 'word1') == TRUE

or strposplus($entry, 'word2') == TRUE

...

 

Does the argument 'word1' get a name by which it can be referenced? Or must I assign it to a named variable before my call to strposplus?

 

Bruce

 

Link to comment
https://forums.phpfreaks.com/topic/50349-referencing-literals/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.