{"id":181,"date":"2020-12-06T13:10:04","date_gmt":"2020-12-06T07:40:04","guid":{"rendered":"https:\/\/selfimagination.in\/tips\/?p=181"},"modified":"2022-01-05T15:36:25","modified_gmt":"2022-01-05T10:06:25","slug":"bootstrap-random-class-use","status":"publish","type":"post","link":"https:\/\/selfimagination.in\/tips\/bootstrap-random-class-use\/","title":{"rendered":"Bootstrap Random Class Use"},"content":{"rendered":"\n<p>Bootstrap Random Class \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0948\u0938\u0947 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0909\u0938\u0915\u0947 \u092c\u093e\u0930\u0947 \u092e\u0947 \u0907\u0938 Article \u092e\u0947 \u092c\u0924\u093e\u092f\u093e \u0917\u092f\u093e \u0939\u0948\u0902 \u0964 <\/p>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">Bootstrap \u092e\u0947\u0902 Colour \u0915\u0947 \u0905\u0928\u0941\u0938\u093e\u0930 \u0905\u0932\u0917 \u0905\u0932\u0917 \u0915\u094d\u0932\u093e\u0938 \u0939\u094b\u0924\u0940 \u0939\u0948\u0902 \u091c\u0948\u0938\u0947 primary, secondary, warning, dark, light \u0906\u0926\u093f, \u0915\u092d\u0940 \u0915\u092d\u0940 \u0910\u0938\u0947 situation \u0906\u0924\u0940 \u0939\u0948\u0902 \u0915\u0940 \u0939\u092e\u0947\u0902 loop \u092e\u0947\u0902 \u0939\u0930 Row \u092a\u0930 \u0905\u0932\u0917 \u0905\u0932\u0917 colour \u0915\u0930\u0928\u093e \u0939\u094b\u0924\u0947 \u0939\u0948\u0902, \u0907\u0938 \u0938\u094d\u0924\u093f\u0925\u093f \u092e\u0947\u0902 \u0939\u092e \u0907\u0938 logic \u0938\u0947 Bootstrap Class \u0915\u094b Randomly \u0909\u092a\u092f\u094b\u0917 \u092e\u0947\u0902 \u0932\u0947 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0964  <\/p>\n\n\n\n<pre title=\"Logic For Change Class every loop\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;html>\r\n\t&lt;head>\r\n\t\t&lt;title>Bootstrap Random Class Example&lt;\/title>\r\n\t\t&lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.1.3\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3\" crossorigin=\"anonymous\">\r\n\t&lt;\/head>\r\n\t&lt;body>\r\n\t&lt;?php\r\n\r\n\t\t$v=0;\r\n\t\t$RandomValue[1] = 'primary';\r\n\t\t$RandomValue[2] = 'secondary';\r\n\t\t$RandomValue[3] = 'success';\r\n\t\t$RandomValue[4] = 'warning';\r\n\t\t$RandomValue[5] = 'danger';\r\n\t\t\r\n\t\tfunction GetColour($RandomValue, &amp;$v)\r\n\t\t{\r\n\t\t\t$v ++;\r\n\t\t\tif ($v > count($RandomValue)) {\r\n\t\t\t\t$v =1;\r\n\t\t\t}\r\n\t\t\treturn $RandomValue[$v];\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$i=0;\r\n\t\twhile ($i&lt;10) \/\/Loop \r\n\t\t{\r\n\t\t\t$i++;\r\n\t\t\t$Clr = GetColour($RandomValue, $v);\r\n\r\n\t\t?>\r\n\t\t\t&lt;div class=\"row p-1 m-1\">\r\n\t\t\t\t&lt;div class=\"btn btn-&lt;?php echo $Clr; ?>\" >Button&lt;\/div>\r\n\t\t\t&lt;\/div>\r\n\t\t&lt;?php\t\r\n\t\t} \/\/\r\n\r\n\t?>\r\n\t&lt;\/body>\r\n&lt;\/html>\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"361\" height=\"531\" src=\"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2021\/11\/image-5.png?resize=361%2C531&#038;ssl=1\" alt=\"Bootstrap Random Class Sequence \" class=\"wp-image-4815\" srcset=\"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2021\/11\/image-5.png?w=361&amp;ssl=1 361w, https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2021\/11\/image-5.png?resize=204%2C300&amp;ssl=1 204w\" sizes=\"auto, (max-width: 361px) 100vw, 361px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">$v <\/h2>\n\n\n\n<p>\u0907\u0938 Variable \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0939\u092e\u0928\u0947 Indexing \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0915\u093f\u092f\u093e \u0939\u0948\u0902 , \u0939\u092e\u0947 \u0939\u0930 \u092c\u093e\u0930 \u0905\u0932\u0917 \u0905\u0932\u0917 Colour \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0928\u093e \u0939\u0948\u0902 Sequence \u092e\u0947 \u0907\u0938\u0932\u093f\u090f \u0907\u0938\u092e\u0947 \u0939\u0930 \u092c\u093e\u0930 \u090f\u0915 \u091c\u0941\u095c\u0924\u093e \u091c\u093e\u090f\u0917\u093e \u0914\u0930 \u091c\u0948\u0938\u0947 \u0939\u0940 \u0938\u0902\u0916\u094d\u092f\u093e Array Count \u0938\u0947 \u092c\u095c\u0940 \u0939\u094b\u0917\u0940 \u092f\u0939 \u092b\u093f\u0930 \u0938\u0947 1 \u0939\u094b \u091c\u093e\u090f\u0917\u093e \u0964 <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">$RandomValue[1] <\/h2>\n\n\n\n<p>\u092f\u0939\u093e \u092a\u0930 \u0939\u092e\u0928\u0947 Array \u0932\u093f\u092f\u093e \u0939\u0948\u0902 \u0914\u0930 \u091c\u094b \u092d\u0940 Bootstratp \u0915\u0947 Standard Colour \u0939\u0948\u0902 \u0909\u0928\u0915\u0947 Name \u0915\u094b \u0907\u0938\u092e\u0947 Assign \u0915\u093f\u092f\u093e \u0939\u0948\u0902, \u092f\u0926\u093f \u0906\u092a \u0907\u0928\u092e\u0947 \u0938\u0947 \u0915\u0941\u091b \u0939\u0940 Colour \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0928\u093e \u091a\u093e\u0939\u0924\u0947 \u0939\u0948\u0902 \u0924\u094b \u0909\u0928\u094d\u0939\u0940 Colour \u0915\u0940 Entry \u0915\u0930\u0947 \u0964 <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GetColour <\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">\tfunction GetColour($RandomValue, &amp;$v)\r\n\t{\r\n\t\t$v ++;\r\n\t\tif ($v > count($RandomValue)) {\r\n\t\t\t$v =1;\r\n\t\t}\r\n\t\treturn $RandomValue[$v];\r\n\t}<\/code><\/pre>\n\n\n\n<p>\u092f\u0939 program \u0915\u093e main Logic \u0939\u0948\u0902 \u0907\u0938\u092e\u0947 \u0939\u092e\u0928\u0947 $v \u0915\u094b Refrence Variable \u0915\u0947 \u0930\u0942\u092a \u092e\u0947 \u0932\u093f\u092f\u093e \u0939\u0948\u0902 \u0914\u0930 \u0909\u0938\u0947 Increment \u0915\u0930 Array \u0915\u0940 Value Return \u0915\u0940 \u0939\u0948\u0902 \u091c\u094b \u0909\u0938 Index \u092a\u0930 \u0939\u0948\u0902 \u0964 <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">$Clr = GetColour($RandomValue, $v);<\/h2>\n\n\n\n<p>\u0907\u0938 \u0924\u0930\u0939 \u0938\u0947 Function Call \u0915\u0930\u0928\u0947 \u0938\u0947  $Clr  \u092e\u0947 primary , secondary \u0906\u0926\u093f \u0935\u0948\u0932\u094d\u092f\u0942 \u0906\u090f\u0917\u0940 \u091c\u094b \u0939\u0930 \u092c\u093e\u0930 \u090f\u0915 Sequence \u092e\u0947 \u092c\u0926\u0932 \u0915\u0930 \u0906\u090f\u0917\u0940 \u0924\u093e\u0915\u093f \u0939\u0930 \u092c\u093e\u0930 \u0906\u092a \u0905\u0932\u0917 \u0905\u0932\u0917 Colour \u0915\u094b \u0905\u092a\u0928\u0947 \u092a\u094d\u0930\u094b\u0917\u094d\u0930\u093e\u092e \u092e\u0947 \u0926\u093f\u0916\u093e \u0938\u0915\u0947 \u0964 <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Rand Function<\/h2>\n\n\n\n<p>\u092f\u0926\u093f \u0939\u092e \u0909\u092a\u0930\u094b\u0915\u094d\u0924 Function \u092e\u0947 \u0928\u093f\u092e\u094d\u0928 \u092a\u094d\u0930\u0915\u093e\u0930 \u0938\u0947 \u092c\u0926\u0932\u093e\u0935 \u0915\u0930 \u0926\u0947\u0902\u0917\u0947 \u0924\u094b \u091c\u094b Colour \u0939\u0948\u0902 \u0935\u0939 \u0907\u0938 \u092a\u094d\u0930\u0915\u093e\u0930 \u0938\u0947 \u0915\u0941\u091b \u0905\u0932\u0917 \u0939\u0940 sequence \u092e\u0947 \u0926\u093f\u0916\u093e\u0908 \u0926\u0947\u0928\u0947 \u0932\u0917\u0947\u0902\u0917\u0947 \u0964 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">function GetColour($RandomValue, &amp;$v)\r\n{\r\n\t$v = rand(1, count($RandomValue));\r\n\treturn $RandomValue[$v];\r\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"360\" height=\"319\" src=\"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2021\/11\/image-7.png?resize=360%2C319&#038;ssl=1\" alt=\"Boostrap Random Class\" class=\"wp-image-4828\" srcset=\"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2021\/11\/image-7.png?w=360&amp;ssl=1 360w, https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2021\/11\/image-7.png?resize=300%2C266&amp;ssl=1 300w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0939\u092e\u093e\u0930\u0947 \u0905\u0928\u094d\u092f ARTICLE<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/selfimagination.in\/tips\/mysql-aggregate-function-in-hindi\/\">MySQL Aggregate Function<\/a><\/li><li><a href=\"https:\/\/selfimagination.in\/tips\/mysql-stored-procedure\/\">MySQL Stored Procedures<\/a><\/li><li><a href=\"https:\/\/selfimagination.in\/tips\/mysql-trigger\/\">MySQL Trigger (Before\/After)<\/a><\/li><li><a href=\"https:\/\/selfimagination.in\/tips\/php-validation-filter-var-preg_match\/\">PHP Form Validations, Required, Filter<\/a>&nbsp;<\/li><li><a href=\"https:\/\/selfimagination.in\/tips\/dbcmd\/\">PHP MySQL Connection<\/a><\/li><li><a href=\"https:\/\/selfimagination.in\/tips\/php-dropdown-from-mysql\/\">Dropdown Retrieve from MySQL&nbsp;<\/a><\/li><li><a href=\"https:\/\/selfimagination.in\/tips\/learn-c-basic-n-advance\/\">Learn C (Single Page Summary)<\/a><\/li><li><a href=\"https:\/\/selfimagination.in\/tips\/arduino-guide-2021-hindi\/\">Arduino Guide 2021 (Hindi)<\/a><\/li><li><a href=\"https:\/\/blog.learncomputer.selfimagination.in\/2020\/10\/keyboard-shortcut.html\">\u0915\u0940\u092c\u094b\u0930\u094d\u0921 \u0936\u0949\u0930\u094d\u091f\u0915\u091f\u094d\u0938<\/a><\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u0906\u0936\u093e \u0939\u0948\u0902 \u092e\u0941\u091d\u0947 \u0915\u0940 \u0906\u092a\u0915\u094b Bootstrap Random Class \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u093f\u0938\u0940 \u092d\u0940 Loop Statement \u092e\u0947 \u0915\u093f\u0938 \u092a\u094d\u0930\u0915\u093e\u0930 \u0938\u0947 \u0915\u0930\u0928\u093e \u0939\u0948\u0902 \u0938\u092e\u091d \u092e\u0947 \u0906 \u0917\u092f\u093e \u0939\u094b\u0917\u093e \u092b\u093f\u0930 \u092d\u0940 \u092f\u0926\u093f \u0915\u094b\u0908 Doubt \u0939\u094b \u0924\u094b \u0906\u092a \u092e\u0941\u091d\u0947 Comment \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0964 <\/p>\n\n\n\n<p>\u092f\u0939 Article \u0915\u0948\u0938\u093e \u0932\u0917\u093e \u0939\u092e\u0947 \u091c\u0930\u0942\u0930 \u092c\u0924\u093e\u090f \u0905\u092a\u0928\u093e \u0915\u0940\u092e\u0924\u0940 \u0938\u092e\u092f \u0926\u0947\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0927\u0928\u094d\u092f\u0935\u093e\u0926 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bootstrap Random Class \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0948\u0938\u0947 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0909\u0938\u0915\u0947 \u092c\u093e\u0930\u0947 \u092e\u0947 \u0907\u0938 Article \u092e\u0947 \u092c\u0924\u093e\u092f\u093e \u0917\u092f\u093e \u0939\u0948\u0902 \u0964 $v \u0907\u0938 Variable \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0939\u092e\u0928\u0947 Indexing \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0915\u093f\u092f\u093e \u0939\u0948\u0902 , \u0939\u092e\u0947 \u0939\u0930 \u092c\u093e\u0930 \u0905\u0932\u0917 \u0905\u0932\u0917 Colour \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0928\u093e \u0939\u0948\u0902 Sequence \u092e\u0947 \u0907\u0938\u0932\u093f\u090f \u0907\u0938\u092e\u0947 \u0939\u0930 \u092c\u093e\u0930 \u090f\u0915 \u091c\u0941\u095c\u0924\u093e \u091c\u093e\u090f\u0917\u093e \u0914\u0930 \u091c\u0948\u0938\u0947 \u0939\u0940 \u0938\u0902\u0916\u094d\u092f\u093e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4835,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,14],"tags":[],"class_list":["post-181","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","category-bootstrap"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2020\/12\/php-bootstrap-random-class.jpg?fit=1200%2C628&ssl=1","_links":{"self":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/comments?post=181"}],"version-history":[{"count":19,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":4837,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/181\/revisions\/4837"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/media\/4835"}],"wp:attachment":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/media?parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/categories?post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/tags?post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}