user1346598 user1346598 - 1 month ago 11
PHP Question

Generate Random IP address using PHP

I would like to generate a random IP adress.

Answer

Chech the mt_rand func .

You'll probably want to run this :

<?php
    $randIP = "".mt_rand(0,255).".".mt_rand(0,255).".".mt_rand(0,255).".".mt_rand(0,255);
?>
Comments