user1346598 user1346598 - 2 months ago 20
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);
?>