user1346598 user1346598 - 11 months ago 111
PHP Question

Generate Random IP address using PHP

I would like to generate a random IP adress.

Answer Source

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);
?>