PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
chopficaro
Forum Commoner
Posts: 68 Joined: Fri Jan 01, 2010 12:56 am
Post
by chopficaro » Tue Jan 24, 2012 5:07 pm
trying to truncate the spaces and \n's on this ****ing string and they wont go away
Code: Select all
for($j=0;$j<$count;$j++)
{
$fieces = explode(" ", $pieces[$j], 2);
echo $fieces[1];
$string = str_replace("\n", "", $fieces[1]);
echo $string;
$string2 = str_replace(" ", "", $string);
echo $string2;
$dbmember[$j]=$string2;
echo "debug ".$pieces[$j].", ".$dbmember[$j]."<br/>";
for($k=0;$k<$i;$k++)
{
if($dbmember[$j]==$name[$k])
{
echo "match at ".$k.": ".$dbmember[$j].", ".$name[$k]."<br/>";
if($check[$j]==0)
{
$check[$j]=1;
}
else
{
die("you have entered the same rank twice");
}
}
else
{
echo "no match :".$dbmember[$j].", ".$name[$k]."<br/>";
}
}
}
chopficaro
Forum Commoner
Posts: 68 Joined: Fri Jan 01, 2010 12:56 am
Post
by chopficaro » Tue Jan 24, 2012 5:15 pm
no matter what i do theres still a /n at the end
chopficaro
Forum Commoner
Posts: 68 Joined: Fri Jan 01, 2010 12:56 am
Post
by chopficaro » Tue Jan 24, 2012 5:25 pm
nm it was just M$ ading their own handy \r newline to everything
god bless M$ and all their time saving features