[PHP] preg_replace with rawurlencoded?

2005-03-18 Thread BlackDex
I have a litle problem with replaceing a string in some HTML code. the html code is: --- --- I want to change the "01%20-%20Raptor%20AMD%20Sempron_image001.jpg" becouse the location of the file will be changed after the upload. the location for instains will be "/images/uploaded/01%20-%20Rapt

[PHP] Re: Tried to run PHP as shell script and got the error...

2005-03-11 Thread BlackDex
Try to put this at top. !/usr/local/bin/php so change the # for a !, becous thas is what is used to execute scripts etc.. :). Hoop it will work. Kind Regards, BlackDex "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi! I'm trying to r

[PHP] Re: PHP RegExp and HTML tags attributes values etc...

2005-03-10 Thread BlackDex
ml; echo ""; $improved_html = preg_replace('/\<(.*)\>/Ueis','"<".tag_rep("\1").">"',$html); echo 'Improved HTML:'; echo str_replace("\\'","'",$improved_html); echo ""; ?> --- &

[PHP] Re: PHP RegExp and HTML tags attributes values etc...

2005-03-10 Thread BlackDex
Owkay.. i fixed it :). Here is the final code. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP RegExp and HTML tags attributes values etc...

2005-03-10 Thread BlackDex
"Jason Petersen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 10 Mar 2005 00:18:05 +0100, BlackDex <[EMAIL PROTECTED]> wrote: >> Hello ppl, >> >> I have a question about regex and html parsing. >> >> I have the f

[PHP] Re: PHP RegExp and HTML tags attributes values etc...

2005-03-10 Thread BlackDex
Thx... it works almost :P I Changed the code a bit so you can see the results quicker :). It doesn't change every attribute/value. I think this has to do something with the opening and closing of a tag <>. My code: --- http://www.php.net/index.php> key=value "; echo 'Normal HTML:'; echo $html;

[PHP] Re: PHP RegExp and HTML tags attributes values etc...

2005-03-10 Thread BlackDex
"Eli" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Eli wrote: >> >> Try: >> >> preg_replace('/(?<=\<)([^>]*)(\w+)=(?\s]+)(?=\s|\>)([^<]*)(?=\>)/U','\1\2="\3"\4',$html); >> Hmm.. that could be a >> start.. and don't ask me how it works... :P > > Well.. problem with that, is that

[PHP] Re: PHP RegExp and HTML tags attributes values etc...

2005-03-10 Thread BlackDex
? Simply sad... while <.*?> do { parse the contents of that tag in someway and change it? } Becouse i think it is imposible with RegEx alone to make it so that it can handle every attribute within a tag. Ltrz BlackDex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP RegExp and HTML tags attributes values etc...

2005-03-09 Thread BlackDex
in advance. Kind Regards, BlackDex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php