How to assign values ​​to PHP arrays

不言
Release: 2023-03-23 21:48:01
Original
3366 people have browsed it

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/>
Copy after login

One of the methods creates an array:

<br/>

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

<span style="font-family:&#39;Courier New&#39;;"></span><br/>

## Running result: a b c d

<br/>
Copy after login

<br/>

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



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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template