Skip to content

Instantly share code, notes, and snippets.

@danilobatistaqueiroz
Last active August 11, 2018 21:39
Show Gist options
  • Save danilobatistaqueiroz/00815c2768ec003cabe48440aa02462b to your computer and use it in GitHub Desktop.
Save danilobatistaqueiroz/00815c2768ec003cabe48440aa02462b to your computer and use it in GitHub Desktop.
Php tips

Find if the installed PHP is threadsafe or nonthreadsafe

Open a phpinfo() and search for the line Thread safety. For a thread-safe build you should find enable.

You can also use:

On Windows : php -i|findstr "Thread"

On Linux: php -i|grep Thread

link: https://stackoverflow.com/questions/5799843/find-if-the-installed-php-is-threadsafe-or-nonthreadsafe


Convert date to string

$result = $date->format('Y-m-d H:i:s');


Clear screen bash

printf '\033c'

Enabling CORS for PHP

<?php
header("Access-Control-Allow-Origin: *");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment