Hello,
I'm trying to get this mod rewrite working, but so far wasn't successful.
The thing is I have a folder called "viri" with a large number of files inside. To reorganize everything I am creating subdirectories a-z 0-9 and moving all files in the appropriate folder according to their first...
Hello,
Here is what I want to do. I have this string for example:
$text="THIS bla blaTHIS bla THISbla THIS THIS";
Now what I'm trying to do is match only those "THIS" that are separate words and NOT part of other words and replace it with THAT. For example the above should become...
Yes, I also don't use IE much. I found that by testing the code in my PHP editor (from www.dzsoft.com) which has an in-built browser.
As for the DOM approach: I haven't got any experience with DOM, will read the manual at http://php.net/dom and see if I can get it to work.
Regards,
c4n
Hi,
EasyPHP (http://www.easyphp.org/) is also installs Apache, PHP, mySQL and phpMyAdmin on Windows computers. This or phpdev should be easier to use if you are just starting, but as atsea said don't be afraid to install all this manually.
Regards,
c4n
Hello both,
Thanks for your valuable posts. Just a little issue with the last code posted, you probably didn't test it DRJ478 otherwise I am sure you would have figured it out.
The above code replaces the test <iframe> to
<iframe width="120" height="240" src="http://www.ask.com></iframe>...
Hi again Lrnmore,
I found a little problem with this part of the RE:
([^src]*)
This doesn't match "src" exactly. If you input a code like this:
$test = <<<END
<iframe scrolling="0" src="http://www.google.com"></iframe>
END;
it brakes on scrolling="" (note the "scr" which is not "src" but...
Hi,
That does the job, many thanks.
I made two small changes:
1. added i modifier to make the pattern case-insensitive. Now it also matches <IFRAME , <Iframe etc.
2. placed stripslashes() within the preg_replace() - this is to avoid the entire HTML code being put throug stripslashes() but...
Hello,
I want to parse some HTML code with PHP and REPLACE the SRC attribute of a <iframe>.
Example INPUT:
<iframe marginwidth="0" src="http://www.yahoo.com" marginheight="0" width="120" height="240" scrolling="no" frameborder="0" ></iframe>
OUTPUT should be for example:
<iframe...
Wow, many thanks, this indeed is a simpler solution that my function :)
Heh, I'm a self-taught programmer and while most of the time I get everything working I usually end up with a complicated function like the one above ;)
Thanks again!
Hello all,
I've decided to post this here as I always get great suggestions here :)
So, I need a function that should return an array with all dates (Y-m-d) between two dates I input.
For example if I input start at '2005-06-01' and end at '2005-06-16' it should return this array:
Array
(...
Hi all,
Thanks to all for posting this, much appreaciated. I will dig through your codes and I am sure I will learn new things abour RE.
Thanks again!
Regards,
c4
Hi Mark,
Thanks for posting.
Unfortunately I can't use that code because it isn't necessary the initial string ($str in your case) will be nicely formatted. It can be
$str = <<<END
some text1,some text2,some text3A{some text1,some text2,some text3}
some text1,some text2,some text3B{some...
Well, I got this combination of regexp and some other code working (at the end $a is what I want), but I was wondering if there is a more fancy way of doing it ;-)
CODE:
$a="
some text1,some text2,some text3
{
some text1,some text2,some text3
}
"...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.