Skip to content

Instantly share code, notes, and snippets.

@jeremyblaze
Created November 26, 2017 03:59
Show Gist options
  • Save jeremyblaze/736a19f2b0093477db223444334288d0 to your computer and use it in GitHub Desktop.
Save jeremyblaze/736a19f2b0093477db223444334288d0 to your computer and use it in GitHub Desktop.
Alerter function
<?php
function alertMe($message, $sound = "pushover") {
$data['message'] = $message;
$data['title'] = "THE TITLE OF YOUR APP";
$data['sound'] = $sound;
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents("THE LINK TO YOUR MIDDLEMAN", false, $context);
}
alertMe('This is just an example', 'cashregister');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment