Skip to content

Instantly share code, notes, and snippets.

@Shakil-Shahadat
Last active June 30, 2022 11:40
Show Gist options
  • Save Shakil-Shahadat/5ee21ddc3a18466fc11ec28d60674418 to your computer and use it in GitHub Desktop.
Save Shakil-Shahadat/5ee21ddc3a18466fc11ec28d60674418 to your computer and use it in GitHub Desktop.
Miscellaneous PHP Codes
<?php
// Todays' date in the format 2022-01-12
echo date( 'Y-m-d' );
// Decode 'encodeURIComponent' encoded string
urldecode( );
// Sanitize $_POST array
foreach ( $_POST as $key => $value )
{
$_POST[ $key ] = $db->escapeString( $_POST[ $key ] );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment