Hello good sirs!
I truly know nothing about php, but know far more regarding computers and software than anyone else in the office here. I know exactly what needs to be changed, but have no idea to what I should be changing it to. I do know that the split function is being replaced in favor of the PCRE equivalent or so I’ve read. According to that website, preg_split() is the function I am looking for, but I have no idea what other things need to be changed since changing just that line won’t do much.
Here is the code for the function it’s referring to…
[php]function wordwrapnew( $string, $cols = 80, $prefix = “”, $splitwith = “\n” )
{
$t_lines = split( “\n”, $string);
$outlines = “”;
while(list(, $thisline) = each($t_lines))
{
if(strlen($thisline) > $cols)
{
$newline = "";
$t_l_lines = split(" ", $thisline);
while(list(, $thisword) = each($t_l_lines))
{
while((strlen($thisword) + strlen($prefix)) > $cols)
{
$cur_pos = 0;
$outlines .= $prefix;
for($num=0; $num < $cols-1; $num++)
{
$outlines .= $thisword[$num];
$cur_pos++;
}
$outlines .= $splitwith;
$thisword = substr($thisword, $cur_pos, (strlen($thisword)-$cur_pos));
}
if((strlen($newline) + strlen($thisword)) > $cols)
{
$outlines .= $prefix.$newline.$splitwith;
$newline = $thisword." ";
}
else
{
$newline .= $thisword." ";
}
}
$outlines .= $prefix.$newline.$splitwith;
}
else
{
$outlines .= $prefix.$thisline.$splitwith;
}
}
return trim( $outlines );
}[/php]
This is part of a web page that uploads files to us. We then access those files using an ftp program. I may have answers to questions, but I don’t know how much help I can be. As I said, I don’t know anything about php.