that's odd no wildcard available. Did you try a % instead of a * ? On 11/5/05, Pete <[EMAIL PROTECTED]> wrote: > > > I want to change a single line in a text file, so I have: > > $find="<loc>http://mydomain.com/myfile.php</loc>\r\n<lastmod>2006-01-01< > /lastmod>"; > > $replace="<loc>http://mydomain.com/myfile.php</loc>\r\n<lastmod>2007-01- > 01</lastmod>"; > > Then: > $result = str_replace($find, $replace, $file); > > > I need line breaks because I have to change the date in the second line, > depending on the filename in the first line. It's on a Windows machine, > so the newline works fine. > > BUT - I don't know the date in $find. I really need something like > $find="<loc>http://mydomain.com/myfile.php</loc>\r\n<lastmod>****-**-**< > /lastmod>"; > wildcards..! but that isn't available. And I can't see how preg_replace > would work here. > > Any suggestions? > > -- > Pete Clark > > > > Community email addresses: > Post message: [email protected] > Subscribe: [EMAIL PROTECTED] > Unsubscribe: [EMAIL PROTECTED] > List owner: [EMAIL PROTECTED] > > Shortcut URL to this page: > http://groups.yahoo.com/group/php-list > > > > SPONSORED LINKS > Job > postings<http://groups.yahoo.com/gads?t=ms&k=Job+postings&w1=Job+postings&c=1&s=18&.sig=3mNuDqhcdaFoXoe-LEll0g> > ------------------------------ > YAHOO! GROUPS LINKS > > > - Visit your group "php-list<http://groups.yahoo.com/group/php-list>" > on the web. > - To unsubscribe from this group, send an email to: > [EMAIL PROTECTED]<[EMAIL PROTECTED]> > - Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/>. > > > ------------------------------ >
-- Thanks, Wes http://www.gmail.com [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/HKFolB/TM --------------------------------------------------------------------~-> Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
