Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function array_to_http( $array )
- {
- $retvar = "";
- while ( list( $field, $data ) = field )
- {
- $retvar .= empty( "retvar" ) ? "" : "&";
- $retvar .= urlencode( $field )."=".urlencode( $data );
- }
- return $retvar;
- }
- function mk_file( $filename )
- {
- if ( !is_file( $filename ) )
- {
- fclose( fopen( $filename, "x" ) );
- return true;
- }
- return false;
- }
- function write2file( $fname, $text )
- {
- $fh = fopen( $fname, "a+" );
- fwrite( $fh, $text );
- fclose( $fh );
- }
- function bet( $start, $end, $intext )
- {
- $rnum = explode( $start, $intext );
- $rnum = explode( $end, $rnum[1] );
- return $rnum[0];
- }
- function get_text( $url, $cookie = 1 )
- {
- $useragent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) --autoposter-- Gecko/20061204 Firefox/2.0.0.1";
- $ch9 = curl_init( );
- curl_setopt( $ch9, CURLOPT_URL, $url );
- curl_setopt( $ch9, CURLOPT_POST, 1 );
- curl_setopt( $ch9, CURLOPT_USERAGENT, $useragent );
- curl_setopt( $ch9, CURLOPT_SSL_VERIFYPEER, false );
- if ( $cookie )
- {
- curl_setopt( $ch9, CURLOPT_COOKIEJAR, "cache/cookie3.txt" );
- }
- curl_setopt( $ch9, CURLOPT_RETURNTRANSFER, 1 );
- $store = curl_exec( $ch9 );
- curl_close( $ch9 );
- return $store;
- }
- function get_text_get( $url, $cookie = 1 )
- {
- $useragent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) --autoposter-- Gecko/20061204 Firefox/2.0.0.1";
- $cha = curl_init( );
- curl_setopt( $cha, CURLOPT_URL, $url );
- curl_setopt( $cha, CURLOPT_USERAGENT, $useragent );
- curl_setopt( $cha, CURLOPT_SSL_VERIFYPEER, false );
- curl_setopt( $cha, CURLOPT_COOKIEJAR, "cache/cookie4.txt" );
- curl_setopt( $cha, CURLOPT_RETURNTRANSFER, 1 );
- $store = curl_exec( $cha );
- curl_close( $cha );
- return $store;
- }
- function get( $url )
- {
- $process = curl_init( $url );
- if ( $GLOBAL['good'] != "good" )
- {
- return;
- }
- $useragent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
- curl_setopt( $process, CURLOPT_USERAGENT, $useragent );
- curl_setopt( $process, CURLOPT_COOKIEJAR, "cache/cookie5.txt" );
- curl_setopt( $process, CURLOPT_TIMEOUT, 30 );
- curl_setopt( $process, CURLOPT_RETURNTRANSFER, 1 );
- curl_setopt( $process, CURLOPT_FOLLOWLOCATION, 1 );
- $return = curl_exec( $process );
- curl_close( $process );
- return $return;
- }
- function rem_bet( $start, $end, $intext )
- {
- $rnum = explode( $start, $intext );
- $string = $rnum[0];
- print_array( $rnum );
- $count = count( $rnum );
- $i = 0;
- while ( $i < $count )
- {
- $rnum = explode( $end, $rnum[$i] );
- $string = "{$string} <br> {$rnum['1']}";
- ++$i;
- }
- return $string;
- }
- function print_array( $array )
- {
- $count = count( $array );
- $i = 0;
- while ( $i < $count )
- {
- echo htmlentities( $array[$i] )."<br>";
- ++$i;
- }
- }
- function print_array_html( $array )
- {
- $count = count( $array );
- $i = 0;
- while ( $i < $count )
- {
- echo $array[$i]."<br>";
- ++$i;
- }
- }
- function clean( $array )
- {
- $remove = array(
- ",",
- "\\",
- ".",
- "!",
- "@",
- "#",
- "\$",
- "%",
- "^",
- "&",
- "(",
- ")"
- );
- $count = count( $array );
- $i = 0;
- while ( $i < $count )
- {
- if ( $array[$i] == "" )
- {
- continue;
- }
- foreach ( $remove as $rev )
- {
- $count1 = substr_count( $array[$i], $rev );
- $pos = strpos( $array[$i], $rev );
- while ( $pos )
- {
- $array[$i] = substr_replace( $array[$i], "", $pos, strlen( $rev ) );
- $pos = strpos( $array[$i], $rev );
- }
- }
- ++$i;
- }
- return $array;
- }
- function rec_bet( $start, $end, $intext )
- {
- $res = array( );
- $rnum = @explode( $start, $intext );
- $count = @count( $rnum );
- $i = 1;
- while ( $i < $count )
- {
- $temp = @explode( $end, $rnum[$i] );
- $res[] = $temp[0];
- ++$i;
- }
- return $res;
- }
- function breakon( $string )
- {
- $brkat = array( " in ", " on ", " and ", " at ", " a ", " are ", " but ", " or ", " so ", " was ", " of ", " as ", ". ", ", ", " the ", " that ", " into " );
- $count = count( $brkat );
- $i = 0;
- while ( $i < $count - 1 )
- {
- $res = explode( $brkat[$i], $string );
- $string = implode( "<>", $res );
- ++$i;
- }
- $string = explode( "<>", $string );
- return $string;
- }
- function seperate( $syn_array )
- {
- $sep_words[] = "";
- $count = count( $syn_array );
- echo $count;
- $i = 1;
- while ( $i < $count + 1 )
- {
- $words = explode( ", ", $syn_array[$i] );
- $count2 = count( $words );
- $j = 1;
- while ( $j < $count2 + 1 )
- {
- if ( $words[$j] == "" )
- {
- continue;
- }
- $sep_words[] = $words[$j];
- ++$j;
- }
- ++$i;
- }
- return $sep_words;
- }
- function just_clean( $string )
- {
- $specialCharacters = array( "#" => "", "\$" => "", "%" => "", "&" => "", "@" => "", "." => "", "\x80" => "", "?" => "", "'" => "", "\"" => "", "=" => "", "\xA7" => "", "\\" => "", "/" => "" );
- while ( list( $character, $replacement ) = character )
- {
- $string = str_replace( $character, "-".$replacement."-", $string );
- }
- $string = strtr( $string, "??????? ??????????????????????????????????????????????", "AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn" );
- $string = preg_replace( "/[^a-zA-Z0-9\\-]/", "", $string );
- $string = preg_replace( "/^[\\-]+/", "", $string );
- $string = preg_replace( "/[\\-]+\$/", "", $string );
- $string = preg_replace( "/[\\-]{2,}/", "", $string );
- return $string;
- }
- function fix_message( $message, $l )
- {
- $message = str_replace( "&039;", "'", $message );
- $message = str_replace( "'", "'", $message );
- $message = str_replace( "&", "&", $message );
- $message = str_replace( """, "\"", $message );
- if ( $l )
- {
- $message = strtr( $message, array( ":" => ":", "@" => "@", "." => ". ", "http://" => "hxxp: ", "/" => " / " ) );
- }
- return $message;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement