String have newline on php to unity

Kawin
if($action == "NewUser")
{
    $action ="INSERT INTO userdata VALUES ()";
    $result = mysqli_query($con,$action);
    $lastid = mysqli_insert_id($con);
    $rename = "guest".$lastid;
    echo $rename;
}

$rename is string that I will use it to compare again in unity-c#

but the problem is I'm try to use == and String.Equals() example i'm got $rename by use unity www http and save it in string temp

if("guest11" == temp)

result is false;

if(String.Equals("guest11",temp))

result is false;

I'm doubt it have something after my string I will try

temp +="myguess";

result should be guest11guess;

but it be

guest11\nguess

c..

It is likely to be elsewhere in your PHP code or a quirk of Unity. Search your PHP files for any newlines after closing ?> tags.

Otherwise, you can temp.Replace("\n", "").

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related