NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP STRING QUESTION

Matt Juszczak matt at atopia.net
Tue Oct 19 13:57:03 EDT 2004


http://us2.php.net/manual/en/function.str-ireplace.php

Hope that helps,

Matt

SALMAN MAZHAR wrote:

> Hello everyone,
>
> My name is Salman Mazhar. I have a script that searches for a keyword 
> in a text file. I am able to search the word using the stristr() 
> function in php. This function is non-case sensitive. However, I want 
> to display the searched word in the line as highlighted in a different 
> color than the line. I use the str_replace() function and replace the 
> word with the word in red color but the str_replace() function is 
> case-sensitive. If I am searching for the word Computer and I type in 
> upper case C, its only going to replace those instances of computer 
> that begin with upper case C and leave the rest of them without any 
> color change. Does anyone know how to get around this problem?
>
> Thanks.
> Sincerely Yours,
> Salman Mazhar.
>
>> From: csnyder <chsnyder at gmail.com>
>> Reply-To: NYPHP Talk <talk at lists.nyphp.org>
>> To: NYPHP Talk <talk at lists.nyphp.org>
>> Subject: Re: [nycphp-talk] Automatically create an object from a form
>> Date: Tue, 19 Oct 2004 12:46:06 -0400
>>
>> You can also use dynamic javascript, a la Chris Hendry's Paxi, see
>> http://nyphp.org/content/presentations/paxi/index.php?slide=4
>>
>> You don't refresh the page, and you don't use XML-RPC -- you use
>> javascript to append a new <script> element to the head of the
>> document, which causes the browser to fetch the script from the server
>> and execute it. Doesn't work in Safari, tho (last we checked).
>> _______________________________________________
>> New York PHP Talk
>> Supporting AMP Technology (Apache/MySQL/PHP)
>> http://lists.nyphp.org/mailman/listinfo/talk
>> http://www.newyorkphp.org
>
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's 
> FREE! hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.newyorkphp.org
>
>
> !DSPAM:417553d3421547084818123!





More information about the talk mailing list