How to define array of strings in PHP

2 Answers

0 votes
$arr = array("php", "c", "c++", "python");
 
print_r($arr);




/*
run:

Array
(
    [0] => php
    [1] => c
    [2] => c++
    [3] => python
)

*/

 



answered Oct 1, 2020 by avibootz
0 votes
$arr = array("PHP is a general-purpose scripting language", 
             "especially suited to web development.", 
             "it was originally created by Danish-Canadian", 
             "programmer Rasmus Lerdorf in 1994");
 
print_r($arr);




/*
run:

Array
(
    [0] => PHP is a general-purpose scripting language
    [1] => especially suited to web development.
    [2] => it was originally created by Danish-Canadian
    [3] => programmer Rasmus Lerdorf in 1994
)

*/

 



answered Oct 1, 2020 by avibootz

Related questions

1 answer 213 views
1 answer 118 views
118 views asked Dec 4, 2020 by avibootz
1 answer 150 views
1 answer 206 views
4 answers 337 views
2 answers 206 views
206 views asked Jun 29, 2016 by avibootz
...