Social Icons

twitterfacebookgoogle pluslinkedinemail

Friday, 28 February 2014

How to Create Randon Number in Magento?

Hello, friends

In magento it is possible that the we are generating  Random number through the following one line code:

Use getRandomString() method and generating random number. In getRandomString() method we pass the number till we get the random number from to 0.





Ex : if we pass the 5 number in gerRandomString() method then it will fetch rendom number from 0 to 5.




<?php
echo Mage::helper('core')->getRandomString(16)
?>


If you want to find this function it is the location:

app\code\core\Mage\Core\Helper\Data.php
Please check in this file for this function


Thank you,

1 comment :

  1. HI you have a good blog i like your blog as it have all the good information. for more information Click on kurtis online shopping

    ReplyDelete

 

Free Advertisement

Free Advertisement

Free Advertisement

Free Advertisement