Category Archives: micro tutorial

Powerful PHP: Less Known String Manipulation

Yet another thing that’s great in PHP is the power you have when doing some string manipulation/operation. Here’s something that is really useful, but I think it remains a bit unknown. Let’s imagine you need to take the first (or … Continue reading

Posted in micro tutorial, PHP | Tagged , , , , , , , , | 5 Comments

PHP: Fetch $_GET as String with http_build_query()

PHP is really full of functions for everything! Most of the time when you try to do something with strings, there’s a function that can do it better and faster. The Route from $_GET to String The global arrays in … Continue reading

Posted in micro tutorial, PHP | Tagged , , , , , , , , , , , , | 3 Comments

PHP Strings: How to Get the Extension of a File

EXE or GIF or DLL or … Most of the code chunks I’ve seen about getting a file extension from a string are based on some sort of string manipulation. $filename = ‘/my/path/image.jpeg’; echo substr($filename, strrpos($filename, ‘.’) + 1); Howerver … Continue reading

Posted in micro tutorial, PHP | Tagged , , , , , , , , , | 2 Comments

OOP JavaScript: Accessing Public Methods in Private Methods

As you know in JavaScript when you define a variable with the special word “var” the scope of this variable is within the function. So when you simply wite “var a = 5″ the variable named “a” has a global … Continue reading

Posted in javascript, micro tutorial, web development | Tagged , , , , , , , , , , , , , , | 2 Comments

A JavaScript Trick You Should Know

JavaScript Strings You should know that in JavaScript you cannot simply write a multilined code chunk, i.e. something like this: var str = ‘hello world’; This will result in an error, which can be a problem when you deal with … Continue reading

Posted in javascript, micro tutorial, PHP | Tagged , , , , , , , , , , , , , , , | 4 Comments