Home >Backend Development >PHP Tutorial >How to assign values ​​to PHP arrays

How to assign values ​​to PHP arrays

不言
不言Original
2018-04-16 09:25:533392browse

The content of this article is about how to assign values ​​to PHP arrays. It has certain reference value. Now I share it with everyone. Friends in need can refer to it


<br/>

One of the methods creates an array:


<?php 
$a="abcd"; 
print($a[0]." ".$a[1]." ".$a[2]." ".$a[3]." "); 
?>

<span style="font-family:'Courier New';"></span>

## Running result: a b c d

<br/>


<?php 
$http=array("www","csdn","net");  
print($http[0].".".$http[1].".".$http[2]);  
?>



The above is the detailed content of How to assign values ​​to PHP arrays. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn