$category->view('PHP');

PHP The Ultimate Getter

When doing OOP (object oriented programming) in any language it’s proper form to have your variables be private and provide get functions for each of them. In languages like C# this is really easy and convenient to do because C# makes it easy to do. PHP was not created to use OOP style methods and it isn’t quite as simple to do. So, I’ve created this function make life a lot easier for myself.

Read more >>

PHP Variable Class Shortcut

This is something kinda fun that I just came across, though I haven’t exactly figured out how I want to use it. Essentially it’s creating extremely dynamic variables. I say extreme because it allows you to set the variables name in a variable and the variables class in a variable. It’s a very short script, check it out…

Read more >>

PHP Get String From Array

If you read my last post about the htmlTagBuilder function, I used a technique of building part of the html tags from a key val array. This is a very useful technique and something else that I had mentioned was how this could be simplified by moving that repetitive code into a function. So, in this post, I’m going to write that function because it’s really quite simple and useful.

Read more >>

PHP Html Tag Builder

About this time last year I was learning how to use CakePHP for a job and it took awhile to get used to, but when I finally started getting the hang of it I started to see how powerful some simple PHP functions could be. I don’t use it anymore, but since then I’ve built a collection of classes based on the things that I really liked CakePHP would do. Now when I write PHP apps I use these constantly for outputting html, creating forms, handling post/get data, etc. I was just thinking up a way to combine pretty much all html tags into one function and wanted to share it.

Read more >>

Dynamic PHP Classes

Object oriented program is the only way to program as far as I’m concerned and a language as flexible as PHP let’s us do some really cool things. One of those things is created dynamic class members. This is made possible by PHP’s flexible use of key value arrays. Don’t know what I mean by dynamic classes? Let us proceed to some examples.

Read more >>

PHP Cookies

Been busy working on a site for the past few days that I’m hoping to have up in the near future. It’s just a hobbyist style site, hopefully it’ll be useful to some people, who knows. But, while working on it I came to the conclusion that Cookies would be my best way to save some of my data. I didn’t want to go through the effort of having people create user’s so I would have a unique ID for each of them just so I could save some checklists for their things. I also thought it would be easiest for this site if I was in control of all data going into the DB and it was all static, so I decided on Cookies.

Read more >>