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" );
?>