Can you add element to array with different data type?
Can you possibly add an element to an array with different data type such as an array of string added with an integer at the last index of the array?
Can you possibly add an element to an array with different data type such as an array of string added with an integer at the last index of the array?
This is so simple. You can add any type of value in a string variable whether it is array or simple variable. You can further change the type of value when you are getting it. There are built functions available to convert any type of value to other value like string to integer.
Â
Â
Hellow Rounthugalog,
The functionality of array is different in different programming language.
But your wish can be done perfectly in all languages.I am giving example of using multiple data type in array PHP language.
At first you have to write the following code into a text file .Then save it as file_name.php on localhost
C:xampphtdocs
Code for utilising of array in PHP
<?php
$Shifflett= array(
"safa" => "Laurel",
"Laurel" =>"safa",
20 => 500,
500 =>20);
var_dump($Shifflett);
?>
Â
Â