Check Markup in PHP File from Command Line

July 31st, 2012 by Laeeq | 2 comments

PHP has a feature that allowed you to check HTML mrkup in your PHP code using PHP command. Just use the -s switch with php command and php file. It will show the HTML markup of your php file.

First create php file “Hello.php”

  1. <?php
  2. echo “\n Hello PHP! \n”;
  3. ?>

Command to check markup in your PHP script:

  1. $ php -s hello-world.php

Below screen showing running php command with html markup

php markup

You can subscribe to PHPZAG.COM posts by Email

 

Related Topics:

  • Wrapping Text using PHP
  • PHP 5.5 beta 4 is now available
  • Swapping Array Keys and Values
  • PHP Security
  • Working with Image Metadata in PHP
  • Converting Between Relative and Absolute File Path
  • Parsing File Paths with PHP
  • How to remove HTML Comments with PHP?
  • How to access .htaccess values?
  • Dealing With Common PHP Errors
  • Interview Questions and Answers for Freshers
  • Display numbers with ordinal suffix using PHP
  • Function to set COLLATION on database fields of Mysql
  • Read and write to remote files using PHP
  • Sharing PHP SESSION Variables between Multiple Subdomains
  • PHP 5.5.0 Alpha4 Development Preview Released
  • Check a string starts with http using PHP
  • Cross-Site Scripting Attacks (XSS)
  • PHP 5.4.11 and PHP 5.3.21 released!
  • PHP Memory Leak Issue
  •  

     

    1. george1
      August 1st, 2012 at 13:33 | #1

      really you have done a fantastic job..keep it up

    2. jacobscottav
      October 3rd, 2012 at 13:57 | #2

      You are my inspiration, I have few blogs and very sporadically run out from brand :) . “Yet do I fear thy nature It is too full o’ the milk of human kindness.” by William Shakespeare.

    1. No trackbacks yet.