HelloWorld in PHP
Since this is a standard program in any language ... here's the PHP version ...
<?php
print("Hello World");
?>
If you compare this with the JSP version of "Hello World" below, you will see why PHP is so MUCH MORE convenient to code.
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.getWriter().println("Hello World");
}
}
<?php
print("Hello World");
?>
If you compare this with the JSP version of "Hello World" below, you will see why PHP is so MUCH MORE convenient to code.
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.getWriter().println("Hello World");
}
}

0 Comments:
Post a Comment
<< Home