Parsing lines from CSV files using Regular Expression
June 21, 2007 on 11:19 am | In PHP | No CommentsMaybe I’m still a newbie at regular expressions, but I searched for a long time yesterday for something that actually works, failing with many code snippets that I found. I finally found something that actually works, so I am posting it here for the benefit of all.
Continue reading Parsing lines from CSV files using Regular Expression…
Separation of POST/GET requests in PHP
June 18, 2007 on 4:26 pm | In PHP, Web apps | No CommentsLast time we talked about MVC application design. There is something I want to write about, stemming from the topic of the last article. It is the separation of POST/GET requests in PHP web apps, which I am an advocate of. It is sort of like a VC (View-Controller) architecture.
This is strictly an application-design topic. I’m not introducing any new fancy functions or features in PHP. It’s about how you design your web app, for better usability. (I happen to be pretty serious about web app usability, which, IMO, all software developers should be, for any software they are working on. This is why so many of my articles focus on what you could do to improve usability — it’s something too many programmers neglect.)
MVC architecture in PHP development
June 10, 2007 on 5:45 pm | In MVC, PHP, Web apps | No CommentsMVC stands for Model-View-Controller. It is a type of architecture for developing software, recently pretty popular in web applications development. In short, the three things are pretty simple. Model is what interacts with the database, it would be the backend class code for an object-oriented language like PHP, Ruby on Rails, or C++. View is basically the user interface. Controller is the logic that operates everything in between.
They are easy to explain, but sometimes the concept is a little abstract and it’s hard to grasp for someone who doesn’t know what MVC is to begin with. To be honest, all my years in web development I never really understood exactly what MVC is, until recently when I started doing development in Ruby on Rails. In this article, I hope to explain MVC architecture development in PHP terms, so the average web apps programmer may benefit from understanding this powerful architecture.
Controlling outputs in PHP
May 21, 2007 on 7:42 pm | In PHP | No CommentsPHP has provided developers with many ways to control outputs, but not many scripts put them into use. Output buffering and flushing are great ways to enhance the usability of your web applications.
In a normal request sent to the web server from the browser, the web server typically responds with the header information and the actual content requested. The header contains numerous things, including the name of the server software, the last modified date and content-type of the document, and others. After the header comes the content. For an HTML page (or any scripts that produce HTML output), that would be the HTML source code of the page.
Inheritance to improve performance
May 17, 2007 on 4:24 pm | In PHP | 5 CommentsFor those of you who went through a CS major in college, you probably know inheritance like the back of your hand. You know how to use it, when is a good opportunity to use it, and you know why… or so you’re told.
If you are a CS student, or a fresh grad working in some company as a programmer, you might be working on object-oriented code with tons of inherited classes — because you were told to do so. However when you get to work on your own projects, especially in a language like PHP, you may not think about it. After all, PHP is a web scripting language — for many small scripts, even procedural code is good enough. You may not even need to use an object-oriented design. How would inheritance come into play?
References in PHP
May 17, 2007 on 3:10 am | In PHP | No CommentsReferences in PHP are important!
This is something I never paid much attention to in the past. I only started using references in my current project. I know for a fact that many less advanced PHP coders never use references, because on the php.net documentation contribution notes, there are actually people who advocate never using references because they are “confusing”.
References are not confusing at all! They work in PHP exactly as they do in C and C++. Keep in mind that references are not pointers, and if you don’t know what references are, I suggest you look it up in a tutorial elsewhere, because I won’t start explaining it, as that will probably take a whole other entry.
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
Save in del.icio.us
StumbleUpon this