Прошу помочь в решении проблемы.
Знания поверхностные и поэтому использовал всю свою скудную "библиотеку" так и не смог найти решение.
Имеется функция вывода случайной строки из файла:
PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- function RandLine($num,$s,$fileName){
- $output = "";
- for ( $i = 0; $i < $num; $i++ ) {
- do {
- $arr[] = $rand;
- }
- return $output;
- }
- ****************Изменить этот кусок кода********************
- function GenTheText( $t ) {
- } return $t;
- }
- $str='';
- ***********************************************************
- function mb_ucfirst($str) {
- return mb_substr(mb_strtoupper($str,'utf-8'),0,1,'utf-8').mb_strtolower(mb_substr($str,1,mb_strlen($str,'utf-8'),'utf-8'),'utf-8');
- }
- $public = RandLine($num = 1,$s = "", $dir."public.txt");
- $attach = "img/".$public.".txt";
- $attachments = RandLine($num = $rand36,$s = ", ", $attach);
- $text = GenTheText($randtext);
- echo $public."<br/>".$attach."<br/>".$attachments."<br/>".$text;
- curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3');
- curl_setopt ($ch, CURLOPT_POSTFIELDS, 'owner_id=-'.$public.'&v=5.28&access_token='.$access_token.'&attachments='.$attachments.'&message='.$text);
- echo "\n".'Login OK'."\n".'[result ===8<===>'."\n".$result."\n".'<===>8=== result]'."<br/>\n";
- echo "http://vk.com/public".$public."";
- ?>