Ok...here is another one for you all. What would be the easiest way to check if a string has a certain text in it. If it does not, add it, but if it does, do nothing. I don't want it to be case sensitive either.
Inputed text : <embed src="http://www.somesite.com/flash.swf">
output text : <embed allowscriptaccess="never" src="http://www.somesite.com/flash.swf">
if inputed like this : <embed allowscriptaccess="never" src="http://www.somesite.com/flash.swf">
or : <EmBed allowscriptaccess="never" src="http://www.somesite.com/flash.swf">
comes out as : <embed allowscriptaccess="never" src="http://www.somesite.com/flash.swf">
here is what i have been trying :
if (!is_int(strpos('<embed allowscriptaccess="never" ', $about))){
$about = str_replace("<embed ", '<embed allowscriptaccess="never" ', $about);
}
// or.....
if (strpos('<embed allowscriptaccess="never" ', $about) === false){
$about = str_replace("<embed ", '<embed allowscriptaccess="never" ', $about);
}
any ideas?