How to Create Flip Text / Upside Down Text

  No comments
Maybe you've seen the status on facebook or tweet on twitter there is writing upside down so it makes more interesting or have never seen at all, then how To make the writing upside down so as to make the status or tweet look more interesting, Here's how to make the writing upside down:

1. Type your writing in the first column (Original)

2. Longer !!! Your writing is automatically reversed in the second column (Reverse / flip)

Original Text:

Fliped text:

Work?

Try to write your comment using reverse writing :D

Search Query with SQL

  No comments

The search system is a system used to search for data that has been stored previously in the database, for a little data may not be necessary, but as more search data is very important to find the data we want, to save time and exact destination / data sought According to what we need, For example: Google, who does not know google? This biggest search engine is one such example, Here are some examples of queries to search:Example 1:
    SELECT table1.field1 FROM table1
    WHERE table1.field1 LIKE "% search%"
    ORDER BY table1.field1 DESC LIMIT 20

In the query "SELECT table1.field FROM table1" so that is shown only field1 in table1 of table1 only to display all the filed can be replaced tabel1.fieldnya with *, then WHERE table1.field1 LIKE "% search%" so with filed1 conditions in table1 We search on the search according to the word we write by replacing the word "search" with the word we want to search, ORDER BY table1.field1 DESC LIMIT 20 sorted by filed1 in table1 by descending (az) with limit displayed / limited by 20 data.But with the query sometimes we use like "% keyword%" is in SQL Statement. What we look for does not appear the example of the scenario, we want to find the top 20 who have the name "eka" because there will be a lot of names, and not to mention the name of the first name or bleakangnya name such as eka haryanto, haryanto eka etc, Finally searched eka does not appear in the top 20 list / top, then the solution using the query model as follows.Example 2:

    SELECT tbl_a.username FROM tbl_a
    WHERE tbl_a._ama_anggota LIKE "% eka%"
    ORDER BY case
    When tbl_a.nama_anggota like "eka" then 1
    When tbl_a.nama_anggota like "eka%" then 2
    When tbl_a.nama_anggota like "% eka" then 3
    Else CONCAT (4, tbl_a.name_members) end LIMIT 20

In the query "SELECT a.name_member FROM tbl_a" so that is displayed only the name of the member in table A of table A only, then WHERE tbl_a.nama_anggota LIKE "% eka%" so with condition nama_anggota in table A that we search on search according to word We write with the word "eka" the word we want to search, then ORDER BY case when tbl_a.nama_anggota like "eka" then 1 when tbl_a.nama_anggota like "eka%" then 2 when tbl_a.nama_anggota like "% eka" then 3 else CONCAT (4, tbl_a.name_members) end LIMIT 20 hereby forces the name of the member whose last name appears at the top followed by the rear variant, the front and the remaining variants, with the limit displayed / limited by 20 data.Thus Query search with SQL there are 2 case examples, where example 1 is a common case example, whereas example2 is a special case example,If any suggestions / maybe there is another statement better please free berargumen but with good manners ya, Happy Coding, And Fighting :)

Examples of Random Functions In PHP

  No comments
The random function is used to randomize a character, to create a random with Integer / Figures type can use the default function of PHP that is with RAND (min, max) as an example:

    <?php
    echo rand (1.10);
    ?>

Then its output is 1-10

But how to make random with letters / alphabets?
The author has not found any special function for random alphabet / letters from PHP, but There are many ways to random functions with these letters / alphabets, including:
Example 1:

    function random ($long) {
       $character = 'ABCDEFGHIJKLMNOPQRSTUabcdefghijklmnopqrstuvwxyz1234567890';
       $String = '';
       For ($i = 0; $i <$long; $i ++) {
           $pos = rand (0, strlen ($character) -1);
           $string. = $Character {$mail};
       }
       return $string;
    }
    echo random (11); // The output of numbers and random letters is 11 characters


 Example 2:

    <?php
    $a1 = str_repeat ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 5);
    $a2 = str_shuffle ($a1);
    echo substr ($a2,0,10); // The output is random numbers and letters of 10 characters
    ?>

 Example 3:

    for ($i = 1; $i <= 10; $i ++) echo chr (rand (97,122));