30
Apr
Apr
In PHP and Scripting |
On 30th April 2010 |
Comments (37)
I use PHP everyday, it is my scripting language of choice for web applications. While I am a fairly advanced user and OO advocate, there are still things that I learn everyday.Here I have compiled a bunch of functions that I have found useful that you probably have never heard of.1. strstr() stristr()Used to compare a partial string to a full string and find a match.Note: strstr is case sensitive, and stristr is not.Usage: ...
11
Sep
Sep
In PHP and Scripting |
On 11th September 2009 |
Comments (40)
Ok so you want pagination on some results that you've pulled from your database. Here's how to do it. In your controller..... // Load the library $this->load->library('pagination'); // Set all pagination config items $config['base_url'] = base_url().'member/admin_member_list/'; $config['total_rows'] = $this->db->count_all('users');...
16
Jun
Jun
In PHP and Scripting |
On 16th June 2009 |
Comments (22)
Something I always forget about, I also usually forget the syntax whenever I need to use it and have to look up examples. Hopefully this will help others too. Rather than echoing variables etc. out as the script is processed, sometimes we need to grab everything and then dump it out to echo once processed. Usually throwing everything into an array, doing an implode and echoing out works, but here is another way. I usually use this in my templating and when creating files with...
16
Jun
Jun
In PHP and Scripting |
On 16th June 2009 |
Comments (35)
Well, I wanted an easier method to listing files in a directory. I used to do it like this.... function dirList($directory){ // create an array to hold directory list $results = array(); ...
4
Jun
Jun
In PHP and Scripting |
On 4th June 2009 |
Comments (38)
I really should create categories for my blog posts, now that Ive built the blog module and comments system for my CMS system. I just cant be arsed right now, so instead for a deflowering of my new blogging module, Im going to put some useful php code up, something that every php coder should simply do for safety sake. Say you have a string that is submitted from a form. $string =...

RSS