techno surprises

December 6, 2007

Random Team Matching with php

Filed under: php, programming — Tags: , , , , , , , , , , , — Mustafa Turan @ 5:26 pm

echo "start\n\n"; $a1 = Array('Chealsea', 'Arsenal', 'Manchester', 'Liverpool');$a2 = Array('Ato', 'Ozi', 'Mustafa', 'Emo');
$b = "0123";

$c = "0123";   for($i=0;$i<(sizeof($a1)-1);$i++) {

if($i!=0){

$b	= str_replace($s1,"",$b);

$c	= str_replace($s2,"",$c);

}

$s1	= substr(str_shuffle($b), 0, 1);

$s2	= substr(str_shuffle($c), 0, 1);

echo $a1[$s1] . ":" . $a2[$s2] . "\n";

}

echo "\n\nend";

July 19, 2007

Translating domain_name to ip_address

Domain names can be translated its related ip addresses.

In windows getting ip_address from domain_name

  1. Click on START menu
  2. Click on RUN and type ‘ cmd
  3. then write ping yahoo.com
  4. and get the ip addres of yahoo

In any UNIX based system getting ip_address from domain_name

  1. Run SHELL client of operating system
  2. type command : ping yahoo.com
  3. and get the ip addres of yahoo

In PHP(web based programming language) getting ip_address from domain_name

<?php
$ip = gethostbyname(‘yahoo.com’);

echo $ip;
?>

Create a free website or blog at WordPress.com.