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 | |
// Import PHPMailer classes into the global namespace | |
// These must be at the top of your script, not inside a function | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
//Load Composer's autoloader | |
require 'PHPMailer/autoload.php'; | |
$mail = new PHPMailer(true); // Passing `true` enables exceptions |
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 | |
$conn = getenv("MYSQLCONNSTR_localdb"); // this will return the whole connectionstring in a single string | |
$conarr2 = explode(";",$conn); // Let's beautify it, by splitting it and decorating it in an array | |
$conarr = array(); | |
foreach($conarr2 as $key=>$value){ | |
$k = substr($value,0,strpos($value,'=')); | |
$conarr[$k] = substr($value,strpos($value,'=')+1); | |
} | |
print_r($conarr); // $conarr is an array of values of connection string | |
?> |
OlderNewer