Forum Moderators: coopster

Message Too Old, No Replies

lower-case string

         

turbohost

5:56 pm on Jun 16, 2004 (gmt 0)

10+ Year Member



Hi,

I want to do this

$file = str_replace("<SCRIPT>","STARTSCRIPT",$file);

but it doesn't look at <script> in lower case. How can I include the lower-case string as well as the upper-case string?

Turbo

Timotheos

6:25 pm on Jun 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



str_ireplace [php.net]

turbohost

6:44 pm on Jun 16, 2004 (gmt 0)

10+ Year Member



Thanks! And how about for

preg_match('/\<title\>(.+?)<\/title\>/is',$file,$title);

I also want to check for <TITLE>?

Turbo

turbohost

6:59 pm on Jun 16, 2004 (gmt 0)

10+ Year Member



Hi,

I'm getting a "Call to undefined function: str_ireplace()" error. Str_replace works fine though although it's case-sensitive.

Turbo

Timotheos

7:29 pm on Jun 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Whoops, str_ireplace is PHP5.

So how about...
$file = preg_replace("/<SCRIPT>/i","STARTSCRIPT",$file);

BTW, regex is my Achille's heel.