web analytics

How to read comment blocks into PHP array?

how to read commented lines into array in php

Did you ever notice the commented lines over theme files, widget and plugin files in PHP in different CMS like WordPress etc.? These comment blocks are not there just because the developer wanted to. These lines can be there as the system may require those lines to describe the file in terms such as the name of the theme or plugin, create date, author name, update date, version number etc. These information about the file then can later be used in the system or CMS.  

Read more

How to pass or use PHP array/variable in JavaScript?

how to pass or use php array or variable in javascript

Multidimensional PHP arrays are similar to multidimensional JSON objects. So shouldn’t be there a way to use a multidimensional PHP array in Javascript? Obviously, and there are ways. For example you can use AJAX to make a request and get the PHP array back in JSON format. However, why to make an AJAX call if the array is ready to be used already? Right.  

Read more

How To Add/Remove a Label To/From Multiple Posts at a Time in Blogger?

Dear blogger users, when we start blogging with blogger we misuse labels in blogger in blog posts. We generally forget that labels in blogger blog posts are like categories. Sometimes we might also not use meaningful labels to blog posts. Instead we use meaningless labels to our blog posts. Thus after a year, when we … Read more

How to use Group Names in PHP preg_match() regex to index matched results by names instead of numeric values

Using regular expressions is a very effective way to find a sub-string or all matched sub-string from a given string or text. But when you call them they give you matched results in a array with numeric indexes which is not helpful enough to get your data out of the matched results. Following is the … Read more