andrisp Posted January 13, 2006 Report Share Posted January 13, 2006 paliidziet luudzu uztaisiit regexpu, kas nolasiitu masiivaa katru rindu, kas saakaas tikai ar vienu # . Pasham kautkaa nesanaak. source file - http://www.nic.lv/local.net Link to comment Share on other sites More sharing options...
[Ya] Posted January 13, 2006 Report Share Posted January 13, 2006 (edited) pamēģini šitā foreach(file('local.net') as $value) { if(preg_match("/^\#.[0-9\.\/]+$/",$value)) { echo "$value = 1\n"; } else { echo "$value = 0\n"; } } Edited January 13, 2006 by [Ya] Link to comment Share on other sites More sharing options...
bubu Posted January 13, 2006 Report Share Posted January 13, 2006 Ak dies... regexpu tam vajag?? Moš FTP konekciju arī pielikt klāt? :) $f = file('local.net') foreach($f as $value) { if (strlen($value) && $value{0}!='#') { echo $value, "\n"; } } Link to comment Share on other sites More sharing options...
Blitz Posted January 17, 2006 Report Share Posted January 17, 2006 sorry par offtopiku, bet kur var dabut informaciju par: preg_match("/^\#.[0-9\.\/]+$/",$value) tiesi ko nozime katrs simbols un kaa veidojas taas kombinacijas. Link to comment Share on other sites More sharing options...
andrisp Posted January 17, 2006 Author Report Share Posted January 17, 2006 ja tu domaa taa vispaariigi, tad - http://www.regexp.info/ ja tu prasi konkreeti par sho piemeeru, tad arii - http://www.regexp.info/ Link to comment Share on other sites More sharing options...
bubu Posted January 17, 2006 Report Share Posted January 17, 2006 http://lv.php.net/manual/en/reference.pcre...tern.syntax.php http://lv.php.net/manual/en/reference.pcre...n.modifiers.php Link to comment Share on other sites More sharing options...
Recommended Posts