Quantcast
Channel: Questions in topic: "webrequest"
Viewing all articles
Browse latest Browse all 387

Why do I get a newline (\n br) while sending a simple string from php to Unity c#

$
0
0
Hi everyone,I'm trying to understand how I can interract between Unity and PHP so I started with simple stuff but it's been 3 days that I'm fighting with this and can't find a solution, I have this simple code: string url = "http://localhost/login.php"; IEnumerator PhpRequest() { WWW webRequest2 = new WWW(url); yield return webRequest2; print(webRequest2.text); } and GUI button that calls the couroutine on click... Then I have the "login.php" file with a simple echo instruction: When I test it I get in Unity console a free line then a, I know this because I tried to execute something if(webRequest2.text == "a") and it didnt work, then I tried print("x"+webRequest2.text) and I got : x a Thanks for reading, and I'm hopelessly waiting for an answer and hoping to finally move on to interesting stuff :'(

Viewing all articles
Browse latest Browse all 387

Trending Articles