Press enter to see results or esc to cancel.

Abraham Garcia Abraham Garcia in PHP Scripts   Friday, November 10 2017

How to Send Push Notification Via CURL PHP PushWoosh

Send Push Notification via PHP cURL API. A simple API call to create message pushwoosh.

This is a code snippet to send a message via PHP cURL through the PushWoosh API.  define('PW_AUTH', 'TOKEN'); define('PW_APPLICATION', 'APP_ID'); define('PW_DEBUG', false); function pwCall($method, $data) { $url =

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Wednesday, November 8 2017

How to Download Multiple S3 File and Zip them together

This is a simple tutorial on how to get AWS S3 object and zip them together.

This snippet will allow you to download multiple S3 files and Zip them together for an easy one download file.  $files_to_zip = array(); $files = array('aws_file_key1.pdf', 'aws_file_key2.pdf', 'aws_file_key3.pdf'); foreach ($files as $f) {

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Monday, November 6 2017

Delete Files Older than 7 Days Via Cron PHP Job

A tutorial on how to delete files from a specific folder that are older than 7 days via a CRON Job. This is in PHP Language.

This will show you how to delete files from a certain folder that are older than 7 days.  $files = glob("folder/*"); if($files){ $now = time(); foreach ($files as $file) { if (is_file($file)) { if ($now -

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Monday, October 16 2017

Presigned URL for AWS S3 Object with PHP

This is a tutorial on how to generate a presigned url for Amazon AWS S3 Object with PHP.

This is a short tutorial on how to create a presigned url for an amazon S3 object. require('./aws/aws-autoloader.php'); use Aws\S3\S3Client; $bucket = 'mybucketname'; $s3 = S3Client::factory(array( 'region' => 'us-west-2',

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Thursday, October 5 2017

How to get POST Variables from Multiple Checkbox Values

A short example on how to get the values of multiple checkbox in a form.

In order to get multiple post variables from checkboxes in your form. You can use the following login in your forms.  <form action="test.php" method="post"> <input type="checkbox" name="check_list[]" value="value 1"> <input

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Tuesday, September 12 2017

Upload a File to AWS S3 Bucket with PHP SDK

This is a sample PHP script on how to upload a file to AWS S3 using PHP SDK

This is a sample script on how to upload a file via the PHP AWS SDK.  require('./aws/aws-autoloader.php'); use Aws\S3\S3Client; $bucket = 'mybucketname'; $s3 = S3Client::factory(array( 'region' => 'us-west-2', 'version'

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Wednesday, August 2 2017

PHP Function to Get Client IP Address

A small function to retrieve the ip address of the user. This uses the PHP Server Method.

This is a function on how to retrieve users ip address. Use this for you projects. function get_client_ip() { $ipaddress = ''; if (isset($_SERVER['HTTP_CLIENT_IP'])) $ipaddress = $_SERVER['HTTP_CLIENT_IP']; else

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Tuesday, April 25 2017

How to Download Most Recent FTP Files Via PHP

A simple PHP script that allows you to download the most recent FTP files from your server.

Want to download your latest FTP files via PHP? Using this php script can help you download the most recent FTP files using plain PHP.  // connect $conn = ftp_connect('ftp.addr.com'); ftp_login($conn, 'user', 'pass'); // get list of files

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Thursday, March 9 2017

How to Send email with PHP and SendGrid

Here are a few examples on how to send email with PHP and SendGrid. Also examples on how to use cURL or SMTPAPI headers.

Here are a few examples on how to send email with PHP and SendGrid.  What is SendGrid? Founded in 2009, after graduating from the TechStars program, SendGrid developed an industry-disrupting, cloud-based email service to solve the challenges

Continue reading
Twilio SMS PHP Sample
Abraham Garcia Abraham Garcia in PHP Scripts   Tuesday, August 9 2016

Twilio SMS PHP Sample

Learn how to send SMS message with Twilio PHP SDK

Twilio is one of the fastest growing telecommunications company. Just last month they launched their IPO. As time passes twilio is bring new features for developers that are being used all around the world.  Today i am going to intruced on of

Continue reading