![]() |
php question
i'm a php programmer, just never really messed with regular expressions. now i'm running into a problem :) I'm trying to creat a regular expression that will read a line of text from a file and if it has href=someurl. But nothing is working. here is what I hvae so far.
PHP Code:
PHP Code:
jDoG |
Go to google and lookup the Tao of Regular Expressions, or go buy Mastering Regular Expressions... or steal it.
|
Well, I'd do this a little differently:
<?php //Something.txt will contain something needed in the search// $fp = @fopen("something.txt", "r"); while($buffer = fread($fp, 1024)) { if(strstr($buffer, "something")) { echo " I found something, $buffer! "; } else { die() } again, I am kind of tired so I am not sure if this will work because I haven't tested it - have no way of testing it - and again, I am sleepy... but if that is something that will help you, USE IT! Peace |
"/href=[\"' ]?([^\"' >]+)[\"' ]?[^>]*>/i"
try this |
Quote:
worked fucking great! jDoG |
All times are GMT -7. The time now is 08:38 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123