If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
PHP range() function , pass किये गए start - end number के according elements का Array create करता है।
range( string|int|float $start , string|int|float $end , int|float $step = 1 );
string | int | float $start | required : यह sequence values के लिए start input है , जो string / int / float type की।
string | int| float $end | required : यह sequence values के लिए end input है , means जहाँ तक sequence end होगा ।
int | float $step = 1 | optional : यह sequence value के लिए as a increment work करता है , या कह सकते हैं Array values के बीच difference . default value 1 होती है means values के बीच 1 number का difference होगा।
Return Value : range() function दिए गए $start से $end तक दिए गए input के according Array return करता है।
File : php_range.php
<?php
$num_array = range(1, 5);
print_r($num_array);
echo "<br />";
$char_array = range('a', 'z', 3);
print_r($char_array);
?>
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 ) Array ( [0] => a [1] => d [2] => g [3] => j [4] => m [5] => p [6] => s [7] => v [8] => y )
? Example में <br> का use सिर्फ line break करने के लिए किया गया है।
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook