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.
is_array() method check करता है , कि कोई variable Array है या नहीं। यह Boolean value true / false ही return करता है।
is_array ( mixed $value );
mixed $value | required : value जिसे आपको check करना है। चूंकि यह function सिर्फ check करता है इसलिए आप किसी भी type की value pass कर सकते हैं।
mixed type का मतलब होता है , कि आप अपनी need के according किसी भी type (String , Boolean , Array , Class , Numeric) की value pass कर सकते हैं। यह जरूरी नहीं है कि कोई special type की value ही pass करें।
Return Value : अगर value एक Array है , तो true return होता है और बाकी conditions में false return होता है।
File : php_is_array.php
<?php
$a = [12, 34];
echo is_array($a) ? '$a is an Array' : '$a is an not Array';
/*Another example*/
echo "<br>";
$b = "String";
echo is_array($b) ? '$b is an Array' : '$b is an not Array';
?>
$a is an Array $b is an not Array
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