PHP hashbang
You can use hashbang in PHP files on Mac/Linux systems to help you quickly build PHP scripts that can be run from terminals quickly. Sample:
File: myscript
#!/usr/bin/env php
<?php
echo 'hello world!';
To make this work for Windows, simply write an accompanying batch file:
File: myscript.bat
@echo off
php %~dp0myscript %*
Beautiful and cross-platform.
Written by Sam-Mauris Yong
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#