This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // https://www.php.net/manual/es/refs.calendar.php | |
| echo date("Y/m/d"); // Current date on format: 2024/12/24 | |
| echo date("Y-m-d"); // Current date on format: 2024-12-24 | |
| echo date("h:i:sa"); // Current hour on format: 04:33:39am | |
| echo date("h:i:s"); // Current hour on format: 04:33:39 | |
| echo date("H:I:s"); // Current hour on format: 20:33:39 | |
| echo date('Y-m-d H:i:s'); // Current date: 2024-07-23 12:34:56 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // VALIDATIONS | |
| filter_var($integerNumber, FILTER_VALIDATE_INT); // verify if variable is an integer number | |
| filter_var("127.0.0.1", FILTER_VALIDATE_IP); // verify if is an IP code | |
| filter_var("[email protected]", FILTER_VALIDATE_EMAIL); // verify if is a correct email | |
| filter_var("https://domain.ext/", FILTER_VALIDATE_URL); // verify if is a correct url | |
| filter_var("true", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); // verify if is a boolean value | |
| filter_var("123.45", FILTER_VALIDATE_FLOAT); // verify if is a float number | |
| //SANITIZE DATA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Session data | |
| $ftpHost = 'ftp.domain.ext'; | |
| $ftpUsername = 'username'; | |
| $ftpPassword = '*****'; | |
| // Connect with ftp host | |
| $conn = ftp_connect($ftpHost) or die("Is not possible connect with ftp host"); |
OlderNewer