PHP Tutorial (& MySQL) #7 - Arrays

PHP Tutorial (& MySQL) #7 - Arrays

Net Ninja

5 лет назад

107,655 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Ete Sol
Ete Sol - 12.03.2023 06:50

Thanks mate. very hekpful 💯💯💯

Ответить
Ever StanDinG
Ever StanDinG - 27.06.2022 01:24

impressed by your creativity with people names : |)

Ответить
Lovie Tech
Lovie Tech - 10.02.2022 16:14

Is there anything like this in php as how it is in python without using loop;

num = [4, 7, 9, 0, 2]
print num[0:2]

This is to print from index 0 to index 2 which the output is 4, 7, 9

Ответить
ARC
ARC - 17.01.2022 13:47

Thank you. great series.

Ответить
Bernard
Bernard - 11.12.2021 21:19

ok cool!

Ответить
Eric196910
Eric196910 - 23.10.2021 18:08

I really love your tutorial. Thanks. Your way of teaching is so clear and is helping me a lot.

Ответить
Devyani Choubey
Devyani Choubey - 01.09.2021 14:20

Code is not available on github

Ответить
Emmanuel John
Emmanuel John - 19.08.2021 14:09

When you say parameters I think you mean arguments, since the parameters are the variables that are declared in the function itself, whereas you are actually placing values when u use the function such as array_push()

Ответить
My Dreamy Nights
My Dreamy Nights - 01.07.2021 19:32

Hello, thank you for your wonderful tutorials. I have done c and c++ before so these are very easy for me. now do I need to learn more about the basic syntaxes or these should be fine? if I need to learn more where should be the perfect place for me? thanks and love :)

Ответить
Md Yousuf
Md Yousuf - 11.04.2021 08:12

Thank You so much the course is really helpful

Ответить
Dibbya Barua
Dibbya Barua - 25.12.2020 08:20

So, associative arrays are similar to std::maps in C++ ... that is very interesting... Love your videos. Very clear, concise, and easily understandable.

Ответить
ASHUTOSH DIXIT
ASHUTOSH DIXIT - 16.12.2020 09:25

ninja
>|(: ***best *****best *****best *** best **best *****

Ответить
Zizou 5
Zizou 5 - 24.11.2020 12:00

I tried to use the array_push() function to associative arrays but it does not work perfectly?? it only allows me to push values and it sets it up to a default key starting from index 0... so it there a way to use the array_push() to add the desired key&value pair?

Ответить
THE CEO
THE CEO - 12.10.2020 05:12

Am Enjoying this so much Shaun, my words may not be enough to appreciate you. but i say thanks

Ответить
dotunn
dotunn - 02.10.2020 17:21

lol, loving the street fighter and Japanese references. That enough made me a fan, very straightforward teaching thanks!

Ответить
T3n Tube
T3n Tube - 03.09.2020 14:39

I learn JS first, and OMG what a mess this PHP

Ответить
D2SProductions
D2SProductions - 14.07.2020 22:35

And the reason why the indexed array works like the way you call for the character at a certain position in a string is because a string is an array of individual characters, I learned that in my Visual Basic class in college. So when you're creating an array of strings you're actually creating a multidimensional array because you have the array of characters for each name and the array for each name entry.
In some of the older programming languages you actually had to create an string array for hold a word consisting of more than one character, an array index for each character of the word, and to have multiple words it would be a multidimensional array because in older programming languages a string only holds a single character, to old more than one character requires an array, it still works that way it's for more modern programming languages it's just built in to the string functionality instead of you having to create a string array just for a single word consisting of more than one character.

Ответить
Sport Giant
Sport Giant - 16.06.2020 19:38

that man save me now ...!

Ответить
InternetUser
InternetUser - 11.06.2020 14:12

Ninja has got the best tutorials for php.... Love it😘

Ответить
Artur Mickiewicz
Artur Mickiewicz - 04.05.2020 14:12

Hi GangMaster!

Ответить
TheChris Grace
TheChris Grace - 17.04.2020 19:50

Do you have a video with an associative array?

Ответить
D Z
D Z - 22.02.2020 14:49

you don't have php course on udemy?

Ответить
Derrick Delancey
Derrick Delancey - 05.02.2020 17:47

If the array was $age = [1,2,3,4].......and you perform the print_r($age) it will display onscreen Array([0]=>1, [1]=>2, [2]=>3, [3]=>4) but is there away to print all the values in the array without all added positions inside the [ ] and => ?

Ответить
Shivam
Shivam - 27.01.2020 20:12

How can I push multiple values in associative array. I mean the syntax?

Ответить
mandizzle0517
mandizzle0517 - 16.12.2019 06:24

thanks net ninja!

Ответить
Shubham Gupta
Shubham Gupta - 01.11.2019 19:15

Shaun plays mario a lot. by the way nice tutorial.

Ответить
Mustafa Мустафа
Mustafa Мустафа - 19.09.2019 23:31

thank you ))) are we gonna use associative ever ??

Ответить
Nicolai Veliki
Nicolai Veliki - 26.07.2019 14:03

so associative arrays are just key-value-maps

Ответить
Sean
Sean - 17.07.2019 19:20

i get this error when i try to create the ages array:


Parse error: Invalid numeric literal in C:\xampp\htdocs\CMS\index.php on line 55

Ответить
HL
HL - 19.03.2019 21:57

some error shows

<?php
//indexed array

$peopleOne = ['happy', 'arun', 'karthik' ];

echo $peopleOne[1];


//assosiative array




?>

<!DOCTYPE html>
<html>
<head>
<title>array</title>
</head>
<body>

</body>
</html>

output


Parse error: syntax error, unexpected '[' in C:\wamp\www\tutorial_php\L7-array\index.php on line 4

Ответить
Abdalla Mohammed
Abdalla Mohammed - 07.03.2019 21:42

Thank you so much, can you please tell us how do you record your screen, and which software do you use? and how you used it ?

Ответить
Tom Scharstein II
Tom Scharstein II - 15.02.2019 21:32

Thanks so much Shaun. I've looked at other "introduction to PHP" articles and content but found they assumed so much prior knowledge that I couldn't even get started -- ended up having no idea how to use, test and run PHP locally each time -- but now thanks to you I've at least got my foot in the door enough to actually experiment and use it instead of failing at the front door.

Ответить
Twenty One Trailers
Twenty One Trailers - 06.02.2019 11:52

Nice and easy, thanks for your efforts.

Ответить
Dmitry Popov
Dmitry Popov - 04.02.2019 23:59

Thank you so much!

Ответить
Atish Mhatre
Atish Mhatre - 04.02.2019 19:56

nice Tutorial Shaun, Thank You!

Ответить
Alessio Clemente
Alessio Clemente - 04.02.2019 14:57

Awesome video! When you reach MySql, could you explain how to actually use this database system, and not only in local? What I usually see is MySql connect ("localhost" "root") but what if the website will be online? Thank you!

Ответить