Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design

Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design

Generating Random Names With PHP

This is a short tutorial on how to generate random names with PHP. With PHP you can automatically generate random name using this script.

In this example, we have two PHP arrays. One contains a list of common names. The other contains a list of common surnames. Using the function mt_rand.



$names = array(
//PHP array containing surnames.
$surnames = array(
//Generate a random name.
$random_name = $names[mt_rand(0, sizeof($names) - 1)];
//Generate a random surname.
$random_surname = $surnames[mt_rand(0, sizeof($surnames) - 1)];
//Combine them together and print out the result.
echo $random_name . ' ' . $random_surname;

Photo Frame Live Wallpaper For Android User

Would you like your pictures to be appearing in the beautiful cube frame as wallpaper in your Android phone?
These fantasy cubes are ideal for you to frame. Using this app you can make photos more beautiful by set as wallpaper by applying animation in it.

Free Download

Live Wallpaper

How to Use:

- Select a photo for box from the gallery.
- Animation is put into wallpaper photo frames for any picture.
- Photo Cube Effects provides the attractive cube live wallpaper.
- You can set photo in the cube and also give your photo to different effect.
- Cube have six side and each side you set different photos from gallery.
- You can select side and different side to set different photos. 
- You can set this cube as a live wallpaper like rotate, move, stand or more.
- You can remove this live wallpaper to long press on those settings. 
- You can set this to your home screen and give your screen to totally different look.


Also share this wallpaper frame with your friends or families through social app.
This cool Live Wallpaper features a rotating 3d photo cube showing pictures and photos from your gallery.

This version now has new extra functionality showcasing features like Change the picture, try out the photo frames and add special effects. Also new floating panels..

In this version cube show different pictures on each side, and change the size, position and rotation of the photo cube. It also allows saving multiple cubes, changing the background and number of floating panels, adds many special effects.

Once installed, on the home screen choose Menu->Wallpapers->Live Wallpapers
Then select Photo Cube Frame Live Wallpaper from the list shown. 
Click on the different menu to change options on your photo cube, or use the convenient Photo cube.


Using this application you set your family’s photo cube frame on your device home screen by crop your family’s photo with shape like square.

You can select your photo from gallery and make your photo frame edit with cropping square shape, Also can you set different movement cube effect like move left to right, right to left, up-down, side by side or more.

No internet connection is required. Simply choose the images from gallery and change the background and easily create a original work of art.

#Photo #Frames #Live #Wallpaper #App on #Android Market.

Free Download

PHP Get Different Number On Page Refresh

This simple php script allow you to get different number on every page refresh. If you want to change value of your php variable on page refresh, this script will help you. Let say i have a default value 1 and want to change it for 2 on page refresh and again 2 to 1 on next page refresh.

    $_SESSION['changenumber'] = 1;
if($_SESSION['changenumber'] == 1){
    $_SESSION['changenumber'] = 2;
    $_SESSION['changenumber'] = 1;
echo $_SESSION['changenumber'];

PHP Find URLs in Text And Make Hyper Link

The basic function of this is to find any URLs in the block of text and turn them into hyperlinks.
It will only find URLs if they are properly formatted, meaning they have a www, http, https, ftp or ftps.


function textTohyperlink($text) {
    // The Regular Expression filter
    $reg_exUrl = "/((((http|https|ftp|ftps)\:\/\/)|www\.)[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,4}(\/\S*)?)/";

    // Check if there is a url in the text
    if(preg_match_all($reg_exUrl, $text, $url)) {
           // make the urls hyper links
           $matches = array_unique($url[0]);
           foreach($matches as $match) {
                $replacement = "<a href=".$match." target='_blank' rel='nofollow'>{$match}</a>";
                $text = str_replace($match,$replacement,$text);
           return nl2br($text);
    } else {
           // if no urls in the text just return the text
           return nl2br($text);

$text = "The text you want to filter goes here.";
echo textTohyperlink($text);

htaccess Temporary Redirect to Maintenance Page

Redirecting visitors to a maintenance page or other temporary page is most important thing while you are updating your site and don't want users to access your site. Using htaccess you can redirect your visitors to a temporary maintenance page. All you need to redirect your visitors is the following code placed in your site’s root htaccess:

htaccess Temporary Redirect to Maintenance Page

RewriteCond %{REQUEST_URI} !maintenance.html
RewriteCond %{REQUEST_FILENAME} !(styles|images).+$
RewriteCond %{REMOTE_ADDR} !^555\.555\.555\.555$
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteRule (.*) /maintenance.html [R,L]

This code makes it easy to temporarily put down your website for updates.

Note: If you only want to access site, you need to change "REMOTE_ADDR" with your own IP address. Images and styles are allowed to pass through the filter as well.


Copyright @ 2016 HKblog.