Category: PHP

0

Selecting Data From XML Tags in PHP

I need to grab the data from the “enclosure” tag from the following feed: https://queryfeed.net/twitter?q=%40CabosNews&title-type=user-name-both&geocode= In the example, you can modify the “enclosure” field to any of the fields you need help grabbing.  This...

0

PHP DateTime Class and Functions

With PHP 5 they introduced the DateTime class.  Prior to that everyone used strtotime, date, etc…commands to achieve the same results.  I was a late adopter and continued to use the old commands.  Recently...

0

PHP strtok

The PHP function strtok splits a string one by one. In the example below I’m trying to split off everything after the ? in the URL. https://www.facebook.com/LiquidWebInc?fref=ts https://www.facebook.com/CocaColaUnitedStates?brand_redir=1 In PHP I was able to...

0

Username Availability Check

This will be a walk-through on how to create a submit form that checks the database to make sure the username is not taken.  If it is taken it will not allow the submit...

0

PHP parse_str

Quick example of how to use PHP’s parse_str command. Here is an example of my data: $source = “access_token=CAAWhyYsjaWsBAOCwjZCs&expires=5180531”; What I’m trying to do is just grab the string of the access_token variable from...

0

Simple Twitter Auto Poster

This is the first in what will end up being a several part tutorial on creating a Twitter posting program.  These tutorials will show how to create the bot using the PHP library that...

0

PHP Date Formatting

A simple example of how to take a date and change it’s format using PHP. August, 3 2015 to YYYY-MM-DD Easily done with the below code: $old_date = ‘August 3, 2015’; $new_date = date(‘Y-m-d’,...

0

Parsing RSS Feed For Images

I’m trying to parse out an RSS feed for images. My original code grabbed the title, description, link, and pubDate just fine. I read a tutorial online on how to get the images out...