PHP make directory or create year months folders

Like in a WordPress website, photos added in posts inside dashboard post editor are kept in dynamically generated year months directories inside wp-content/uploads directory by default. This blog will assist you to make directory in PHP and we will then create year months folders at our server.

Read More

Ajax Image Upload using PHP and jQuery

Ajax Image Upload using PHP and jQuery is very important topic nowadays because everybody wants to save their data without refreshing the page. Today we are going to generate an Ajax based image uploader, which means the image file will be uploaded to server using Ajax request, without reloading the page.

Read More

Automatic Update Copyright Year

Still wonder how to automatic update copyright year instead of changing hard-coded value each year. Lol!! You need some fresh air to let your mind breathe. Use PHP’s date() function which can echo the current year in your copyright text.

Copyright ©< ?php echo date('Y'); ?> | Your Company Name

Read More

Number of days in a month

PHP provides functions to get the number of days in a month for a specified year and calendar. We can use date(‘t’) or cal_days_in_month. See syntax, parameters and examples in rest of the article.

Read More

Embed base64 encoded images

Most modern desktop browsers such as Chrome, Mozilla, Internet Explorer supports images encoded as data url. But there are problems displaying data URLs in some mobile browsers like Android Stock Browser.

Here we are presenting that how we can embed base64 encoded images in various platforms.

Read More

Apply foreign key in phpMyAdmin using database query

If you already have database tables and you just want to apply foreign keys for record on those table then you can apply foreign key in phpMyAdmin using database query also.

I have already written a tutorial ‘Setting up foreign key in phpMyAdmin‘ with example images and I prefer to write database query to set up foreign key in existing database tables as queries allow me to accomplish all required steps in once go.

Read More

Hide or remove controller name from url in Yii 2.0

You can hide or remove controller name from url in Yii 2.0 through configuring rules for urlManager component. You can hide controller name from url even if your pages are generated dynamically using database after reading this article.

First of all you have to enable pretty permalinks. After that let’s try to understand how to configure application rules by simple examples.

Read More

[ Page 2 of 4 ]