Jump to content

deviant_two

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

About deviant_two

  • Birthday 09/22/1982

Profile Information

  • Gender
    Male

deviant_two's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. try this <?php ##### DECLARE THE FUNCTION if (!function_exists("string_rn")){ #> this F will avoid declaring this F twice (usual programmer use include() rather than include_once() method ) function string_rn($string){ //func_get_arg(1); //func_num_args(); # optinal (you can add your additional parameter here just dont forget 'func_get_arg($y0Ur_nUmBEr)' ) # this F will convert \n (Unix Style) (ASCII 10 (0x0A)) , \r (Mac Style) , \r\n (Win Style) $string=func_get_arg(0); $to="\n"; if (func_num_args()>1){ $to=func_get_arg(1); } # this '$dump' var it just for creating new dump var $dump= mktime ( date ("H") ,date ("i") ,date ("s") ,date ("m") ,date ("d") ,date ("y") ) .date ("Y-m-d") .date ("H:i:s") .tempnam ; if (function_exists("sha1")){$dump=sha1($dump);} # sha1 availabe in (PHP 4 >= 4.3.0, PHP 5) # $willReplace=array (); $willReplace["src"]=array();$willReplace["des"]=""; $willReplace["src"][]="\r\n";# \r\n (Win Style) $willReplace["src"][]="\r";# \r (Mac Style) $willReplace["src"][]="\n";# \n (Unix Style) $willReplace["des"]=$dump; if (function_exists("str_ireplace")){ $string=str_ireplace( $willReplace["src"] , $willReplace["des"] , $string ); # Only available in PHP 5 # }else{ $string=str_replace ( $willReplace["src"] , $willReplace["des"] , $string ); # Available in PHP 4,5,6 # } if (function_exists("str_ireplace")){ $string=str_ireplace( $willReplace["des"] , "$to" , $string ); }else{ $string=str_replace ( $willReplace["des"] , "$to" , $string ); } return $string; unset( $string , $willReplace , $dump) ; };}; ?> <?php ##### APPLYING THE FUNCTION $str = " should i use unset() function inside myOwn functions ? I really dont have a idea about this really? Oh thank u for replying "; header("Content-type: text/plain"); print ( "(" . string_rn($string) . ")\n" ); print ( "(" . string_rn($string, "<=>" ) . ")\n" ); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.