You are here: Re: Regular Expression replacement « All PHP « IT news, forums, messages
Re: Regular Expression replacement

Posted by hol on 11/06/07 21:38

Thanks for your reply Steve.

I tried what you suggested
$pvid = str_replace(" /width\s*?:\s*?\d{1,3}px/i","width:800px",$pvid) ;
but unfortunatelly did not work.




Ο "Steve" <no.one@example.com> έγραψε στο μήνυμα
news:K23Yi.56$zj4.25@newsfe02.lga...
>
> "hol" <contact7@hol.gr> wrote in message
> news:fgq5d0$e6d$1@newsmaster.pub.dc.hol.net...
>> Hello,
>>
>> I want to replace all accurences of the substring
>> width:000px (where 000 is any 3 digit number)
>> with the string
>> width:800px.
>>
>> For example the following string :
>> style="width:400px; height:326px;" id="VideoPlayback"
>> type="application/x-shockwave-flash"
>> should be changed to
>> style="width:800px; height:326px;" id="VideoPlayback"
>> type="application/x-shockwave-flash"
>>
>> so I used the following command :
>> $pvid = str_replace("width:[1-9][0-9][0-9]px","width:800px",$pvid) ;
>>
>> but it does not seem to work.
>>
>> Any ideas on this?
>
> /width\s*?:\s*?\d{1,3}px/i
>

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация