Friday, March 14, 2014

PHP "strstr" function in Javascript

If you are looking for PHP's strstr function in Javascript you can use following javascript function,

function strstr(haystack, needle, bool) {
   var pos = 0;

  haystack += '';
  pos = haystack.indexOf(needle);
  if (pos == -1) {
    return false;
  } else {
    if (bool) {
      return haystack.substr(0, pos);
    } else {
      return haystack.slice(pos);
    }
  }
}


Reference : http://phpjs.org/functions/strstr/

Monday, January 26, 2009

Change the Google Logo by your name

In this tutorial you will learn how you can make your own personal search engine with a custom name as logo. or How you can change the Google Logo by your name

  1. Open your browser and go to the site http://www.funnylogo.info
  2. Type the name for your search engine.
  3. Select the logo style. You can choose from a lot of styles including: Google Style, Yahoo!, Lord of the Rings, Shrek, Coca Cola, Matrix, Mickey Mouse, Harry Potter, etc.
  4. Click Create Search Engine.
  5. You search engine will be created. For this engine we used Google style