Вот мой код.
PHP |
<?php |
PHP |
$files = file('sites.txt'); |
PHP |
echo preg_replace('/\s+$/', null, $files[3]); |
Цитата (Grimyar @ 31.01.2009 - 00:01) |
без пробела на конце строки |
PHP |
$files[3] .= "end_of_string"; |
PHP |
<?php |
HTML |
<html> <head> <meta content="text/html; charset=Windows-1251" http-equiv="content-type"> <title>x x x x x x</title> </head> <body style="background-color: rgb(204, 255, 255); color: rgb(0, 0, 0);"alink="#ee0000" link="#0000ee" vlink="#551a8b"> <nobr>http://wokod.ru /index.php?do=register</nobr> </body> </html> |
HTML |
<html> <head> <meta content="text/html; charset=Windows-1251" http-equiv="content-type"> <title>x x x x x x</title> </head> <body style="background-color: rgb(204, 255, 255); color: rgb(0, 0, 0);"alink="#ee0000" link="#0000ee" vlink="#551a8b"> <nobr>http://wokod.ru/index.php?do=register</nobr> </body> </html> |
PHP |
<?php |
PHP |
echo trim("http://$files[3]/index.php?do=register"); |
PHP |
echo 'http://' . trim($files[3]) . '/index.php?do=register'; |