-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharray.php
40 lines (34 loc) · 914 Bytes
/
array.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
$array = array("Softweb","Technologies","Ahmedabad","Gujarat");
print_r($array);
echo "<br>";
// 2 Type of array
// 1. General
// 2. Associate Array
$assArr = array('Abcd' => "Softweb", "Bcde" => "technologes");
print_r($assArr);
echo "<br>";
$arrKey = array_keys($assArr);
print_r($arrKey);
echo "<br>";
// Array to String
echo implode(" ",$array);
$str = "Softweb Technologies Ahmedabad Gujarat";
echo "<br><br>";
$strArr = explode(" ",$str);
print_r($strArr);
echo "<br>";
foreach($array as $arrdata){
echo $arrdata."<br>";
}
$arrDuble = array(
array("Softweb","Techno","IT"),
array("Ahmdabad", "Gujarat")
);
foreach($arrDuble as $arr){
foreach($arr as $data){
echo $data." || ";
}
echo "<br>";
}
?>