Good Bye From Geeks On PHP

It has been a long time (far too long) since we let everybody know what is going on with Geeks On PHP so here I am to do exactly that. Due to some scheduling issues and unforeseen events Stephen and I have decided to disband the Geeks On PHP podcast. We had a great time bringing you weekly discussions on PHP, web development, databases and everything in between.

I recently started a new project called TweetPHP which is a web site and podcast focused on collaborative PHP development. We are using github to host our codebase and allow users to fork off their own copies of the repository and add/modify/contribute. If you are interested in a podcast focused on PHP and were still waiting for the OOP series then I urge you check out TweetPHP as we will be discussing object oriented programming in our next episode.

I will still be contributing to For the Love of Geeks in the form of blog posts and helping maintain the twitter account. If you are interested in seeing what else I am up to please check out http://nicholaskreidberg.com.

Thanks,

- Nicholas

Share

Read Users' Comments (2)

Geeks On PHP Episode 13

This week Stephen and I talk about strings and how they are accessed, manipulated and used in PHP.

We kick off the discussion talking about some differences between echo() and printf(). Below is an example of using both functions to populate a text field on a web form. We will start off with using echo():


.. input type="text" name="foo" id="foo"
[Inside PHP Block]
if(!empty($dbresult['foo']))
echo ' value="'.$dbresult['foo'].'" />';
else
echo ' value="" />';
?>

Here is the same end-result using printf():


... input type="text" name="foo" id="foo"
[Inside PHP Block]
printf(" value=\"%s\" ", !empty($dbresult['foo']) ? $aResults['foo'] : "");
?>

I tried to make the “argument” during the show that printf() allows for a lot more flexibility as well as resulting in slightly more compact code. Notice the usage of PHP’s ternary operator in the printf() example. It allows for a great deal of flexibility and power directly in-line w/ your output statement.

Regular Expressions were also a big topic of discussion this week and as promised here are some examples of commonly used RegEx’s in web application development:


$pattern_date = '#(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d#';
$pattern_email = '#^[a-zA-Z._]+@[a-zA-Z_]+?\.[a-zA-Z]{2,4}$#';
$pattern_email2 = '#^\w+([\.%-]\w+)*@\w+([\.-]\w+)*(\.\w{2,})+$#';
$pattern_phone = '#^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$#';
$pattern_time = '#(1[0-2]|[1-9]):([0-5][0-9])#';
$pattern_url = '#(http|https)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,4}(/\S*)?$#';
$pattern_alphanum = "#^[a-zA-Z0-9\s]+$#";

To test matching on these patterns you can simply use the preg_match() function:

preg_match($pattern, $string, $matches);
if(!empty($matches))
    print_r($matches);

A couple of my favorite resources for regular expressions are:
The Online Regular Expression Testing Tool
The Regular Expression Library

Regular Expressions provide so much power and versatility when it comes to pattern matching and replacements that they just can’t be ignored. If you have questions about any of the above please let us know.

Follow both Stephen and Myself on Twitter and also subscribe via Tunes!

Enjoy the show and as always, stay geeky!

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

- Nicholas

Share

Read Users' Comments (1)

Geeks On PHP Episode 12

In this episode Stephen and I talk about database connections, retrieving results and making use of those results. Both MySQL and PostgreSQL are discussed in this episode so whichever open source database you are using we got you covered.

Here is a link to Stephen’s database class for MySQL. He discusses it’s usefulness and some of it’s functions in the show.

Here is some sample code for getting connected to and pulling out results from a PostgreSQL database. The database include file should be separate from your application code so that you can easily change connection parameters in one location without touching your application.

/* Example of PostgreSQL database include file
	named db.inc */

$host = "hostname";
$port = "port";
$dbname = "database";
$dbuser = "username";
$dbpass = "dbpass";

$hdb = pg_connect("host=$host port=$port dbname=$dbname
	user=$dbuser password=$dbpass");

/* How to include and open connection in script */
require_once("db.inc");

/* How to query a PostgreSQL database */
$res = pg_query($hdb, "SELECT name, email FROM table");

/* Close database connection */
pg_close($hdb);

/* Create associative array */
while($ares = pg_fetch_assoc($res))
{
	// do stuff
}

/* Create object */
while($ores = pg_fetch_object($res))
{
	// do stuff
}

Check both Stephen and Myself out on Twitter and also subscribe to us on iTunes!

Enjoy the show and as always, stay geeky!

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

- Nicholas

Share

Read Users' Comments (2)

Geeks On PHP Update

Hey everybody, I just wanted to let you know that I have been out of town for a few days and wasn’t able to find time to record last weeks show. I apologize for the unannounced delay and want to let everyone know that we are set to record this Wednesday and I will make it a point to get the episode out ahead of the usual Sunday release. If you are wondering what I was up to you are welcome to check out my latest Flickr set.

Thank you for your patience and I will let everybody know via the usual channels when Episode 11 is available.

Thanks,

- Nicholas

Share

Read Users' Comments (1)

Geeks On PHP Episode 10

We are happy to bring you episode 10 of the Geeks On PHP Podcast!  This week we talk about API programming, specific API’s that we have worked with, some great development tips and even alcohol.  This episode has it all.

The Authorize.net API comes up a bit in discussion and I mention the article I wrote a couple of days ago regarding some changes to online debt card processing as it pertains to the Authorize.net API.

We invite you to follow both Stephen and I on Twitter and also subscribe to us on iTunes!

Enjoy the show and as always, stay geeky!

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

- Nicholas

Share

Read Users' Comments (0)

Geeks On PHP – Episode 9

After a long wait, Geeks on PHP – Episode 9 is finally out!  As I mentioned in a previous post we are now on a weekly recording schedule and will be releasing a new episode every Sunday evening unless otherwise specified.

In this exciting episode we discuss lots of information and things to think about *before* you start building your database or writing your application.  We also touch on SQL statements, database schema design and how they relate to your PHP applications.

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Also, subscribe to us on iTunes and leave us your comments: [ Launch iTunes ]

Follow us on Twitter :
Nick : http://www.twitter.com/niczak
Stephen : http://www.twitter.com/darthweef

- Nicholas

Share

Read Users' Comments (0)

Geeks On PHP Is Alive!

Geeks On PHPHey all, I just want to give everybody an update on the Geeks On PHP podcast.  Stephen and I have arranged our schedules as such that we will be on a regular weekly recording schedule beginning NEXT WEEK.  This is very exciting news for us and for our listeners.  We apologize for the gaps between episodes in the past and the long gap between our last recording and the upcoming one.

Episode 9 will be focused on discussing different ways to utilize data from a database (agnostic discussion) with PHP.  We are set to record on Wednesday 4/28 and the show should be available on iTunes by the weekend.

We really want to thank all of our listeners for the feedback and support we received during our down time.  It means a lot to both of us and we look forward to getting back on track and bringing you the best PHP podcast the internet has to offer.

Sincerely,

- Nicholas Kreidberg

Share

Read Users' Comments (1)

Geeks on PHP — Update

geeksOnPHP

Hey all, I know the release schedule for the Geeks on PHP podcast has been erratic and unpredictable lately. We are currently in the process of revamping the format of the show including me taking over as host and the possibility of adding someone else as co-host. Stephen’s responsibilities with the New Brew Thursday podcast have increased exponentially which is the underlying reason behind the changes going on with Geeks on PHP.

I have a couple people in mind for co-hosts but would love to get feedback from our readers/listeners about what you would like to get out of the show. If any of you are interested in doing a guest spot please get in touch with me either by Email or on Twitter.

I will keep everybody updated as things progress but for now I just wanted to make people aware of what is going on and also that the show is not dead.

Thanks for listening and please don’t hesitate to comment, email or otherwise — your involvement is highly encouraged!

Sincerely,

- Nicholas Kreidberg

Share

Read Users' Comments (0)

Geeks on PHP : Episode 8 : MySQL vs. PostgreSQL

This week we dive into the debate that has raged since the first database went online, MySQL or PostgreSQL ..

Stephen is a MySQL guy, while Nick is a PostgreSQL guy, and together they share the pros and cons of both, and why the debate that has raged is not likely valid anymore.

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Also, subscribe to us on iTunes and leave us your comments: [ Launch iTunes ]

Follow us on Twitter :
Stephen : http://www.twitter.com/darthweef
Nick : http://www.twitter.com/niczak

Share

Read Users' Comments (0)

Geeks On PHP : Episode 7 – Looping through while, for and foreach

At the heart of every redundant thing you do, is a loop.

Even the greeks knew it.  When Sisyphus pissed off the gods, they stuck him in a while loop

while($gods == “pissed”) {

$sisyphus = “Roll rock up a hill”;

}


Granted the greek gods were a bit tempermental, but like the greeks, your application will execute these types of statements to output data, count, and do all sorts of things that are even, at times, incredibly futile and redundant.  Also like gods, while loops can be tempermental, and when hastily constructed can leave Sisyphus pushing his rock for all of eternity.

Wondering who Sisyphus is ? http://en.wikipedia.org/wiki/Sisyphus

PHP Manual on Control Structures: http://us2.php.net/manual/en/language.control-structures.php

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Also, subscribe to us on iTunes and leave us your comments: [ Launch iTunes ]

Follow us on Twitter :
Stephen : http://www.twitter.com/darthweef
Nick : http://www.twitter.com/niczak

Share

Read Users' Comments (1)

 Page 1 of 2  1  2 »