Unity3d Tutorial Web Server Chapter: (Third speaking) PHP's Hello World

Source: Internet
Author: User
Tags php hello world php tutorial

reproduced from Wind Yu Chong Unity3d Tutorial College

Introduction: PHP is a relatively simple programming language, even if not touched can be learned now.
PHP Tutorial Documentation
PHP100 Video Tutorial
Unity receives the output of PHP Hello world.

Enter the WWW folder, right-click New text document, named helloworld.php, open with Notepad, enter the following code, save.

<?php

Echo is similar to cout or print, which outputs text content in a Web page

echo "Hello world!";

?>

After that, open the browser input http://localhost/helloWorld.php, the page results are as follows.New Unity Project,Create an object, create a script Getecho, drag the script onto the object, the script as follows using unityengine;using System.Collections; public class Getecho:monobehaviour {void Ongui () {if (GUI. button (new Rect (0,0,100,50), "Getecho")) {Startcoroutine (GetText ());}} IEnumerator GetText () {www mywww = new WWW ("http://localhost/helloWorld.php"); yield return mywww;print (Mywww.text);}} Run, click on the top left button, that is, the console output the HelloWorld statement on the page, how simple?

Unity3d Tutorial Web Server Chapter: (Third speaking) PHP's Hello World

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.