Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
11 user(s) are online (6 user(s) are browsing Forums)

Members: 0
Guests: 11

more...

Support us!

Headlines

 
  Register To Post  

Backslashes in OS4Depot readmes disappear
Not too shy to talk
Not too shy to talk


See User information
Backslashes in the readme text for files on OS4Depot are removed when you view them. Maybe an addslashes() is needed somewhere?

Go to top
Re: Backslashes in OS4Depot readmes disappear
Supreme Council
Supreme Council


See User information
@xeron

I know, I have code that wraps text in 80 columns with some intelligence in it that doesn't work the way I want it to. I got it from nicomen, but unfortunately I've never bothered to learn what preg_replace does to be able to fix it.


function smartWrap($text,$width,$break="\n",$cut=1)
{
$text = str_replace("$", "&#36", $text);

if (preg_match("/[^\n]{".$width."}/",$text))
{
$text = preg_replace("/\\\\('|\")/msi","$1",preg_replace("/(.*?)(\n\n|\.\n|:\n|=+\n|\s*-{3,}\s*\n)/msie",'(preg_match("/[^\n]{$width}/mi","$1")) ? preg_replace("/(\S+)[\t ]?\n/","\$1 ","$1")."$2" : "$1$2"',$text));
$text = str_replace(""&#36"","$",$text);
return wordwrap($text,$width,$break,$cut);
}
else
{
return $text;
}
}

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project