search
HomeBackend DevelopmentPHP TutorialChapter 5 PHP Array Operation_PHP Tutorial

Chapter 5 PHP Array Operation_PHP Tutorial

Jul 21, 2016 pm 03:21 PM
phponeWhatelementcommonandoperatearrayyeshavechaptertype

one. What is an array
An array is a set of elements that share certain characteristics, including similarity and type.
Each element is distinguished by a special identifier, called a key, and each key has a value
1. Two ways to create an array:
1.1 Use the array() function

Copy code The code is as follows:

$usernames = array ('Alerk', 'Mary' , 'Lucy', 'Bob', 'Jack', 'John', 'Mark' );
foreach ( $usernames as $name )
{
echo $name . '
}
?>

output
Alerk
Mary
Lucy
Bob
Jack
John
Mark
1.2 Use range() function
Copy code The code is as follows:

$ numbers = range ( 0, 10 );
foreach ( $numbers as $num )
{
echo $num . '
';
}
$letters = range ( 'a', 'z' );
foreach ( $letters as $letter )
{
echo $letter . '
';
}
? >

output
0
1
2
3
4
5
6
7
8
9
10
a

c
d
e
f
g
h
i
j
k
l
m

o

q
r

t
u
v
w
x
y
z
2. Two ways to loop through array elements:
2.1 for loop
Copy code The code is as follows:

//The third parameter of range represents the step size
$numbers = range(1,10,2);
for($i = 0 ;$i{
echo $numbers[$i].'
';
}
?>

output
1
3
5
7
9
2.2 foreach loop
Copy code The code is as follows:

$letters = range('a','h',2);
foreach($letters as $letter )
{
echo $letter.'
';
}
?>

output
a
c
e
g
Foreach can also be used to output the subscript and corresponding value of the array
Copy code The code is as follows:

$letters = range('a','g',2);
foreach($letters as $key => $value)
{
echo $key.'---'.$value.'
';
}
?>

output
0-- -a
1---c
2---e
3---g
3.is_array() function, used to determine whether the variable is an array
Copy code The code is as follows:

$numbers = range(1,10,2);
if( is_array($numbers))
{
foreach($numbers as $num)
{
echo $num.'
';
}
}
else
{
echo $numbers;
}
?>

4.print_r function, prints easy-to-understand information about variables
Copy code The code is as follows:

$usernames = array ('Jackie', 'Mary', 'Lucy ', 'Bob', 'Mark', 'John' );
print_r ( $usernames );
?>

output
Array ( [0] => ; Jackie [1] => Mary [2] => Lucy [3] => Bob [4] => Mark [5] => John )
The source code can be seen as:
Array
(
[0] => Jackie
[1] => Mary
[2] => Lucy
[3] => Bob
[4] => Mark
[5] => John
)
2. Custom key array
1. If you don’t want to create an array with the default subscript zero, you can use the following method to create an array with keys as strings
Copy code The code is as follows:

//Initialize array
$userages = array('Jack'=> 23,'Lucy'=>25,' Mark'=>28);
//Accessing each element of the array
echo $userages['Jack'].'
';
echo $userages['Lucy']. '
';
echo $userages['Mark'].'
';
?>

2. Go to Customize Append elements to the key array
Copy code The code is as follows:

//Initialize array
$ages = array('Jack'=>23);
//Append elements
$ages['Lucy' ]=25;
$ages['Mark']=28;
foreach($ages as $key => $value)
{
echo $key.'----' .$value.'
';
}
?>

3. Add elements directly without creating an array.
Copy code The code is as follows:

//Add directly without creating an array
$ ages['Jack']=23;
$ages['Lucy']=25;
$ages['Mark']=28;
foreach($ages as $key => $value )
{
echo $key.'----'.$value.'
';
}
?>

4. Use of loop printing array foreach
Copy code The code is as follows:

$ages[ 'Jack']=23;
$ages['Lucy']=25;
$ages['Mark']=28;
foreach($ages as $key => $value)
{
echo $key.'=>'.$value.'
';
}
?>

5. each () -- Returns the current key/value pair in the array and moves the array pointer forward one step
Copy code The code is as follows:

$ages['Jack']=23;
$ages['Lucy']=25;
$ages['Mark']=28;
$ a = each($ages);
print_r($a);
echo '
';
$a = each($ages);
print_r($a) ;
echo '
';
$a = each($ages);
print_r($a);
?>

Use each() function to do loop printing
Copy code The code is as follows:

$ages[ 'Jack']=23;
$ages['Lucy']=25;
$ages['Mark']=28;
while(!! ​​$element = each($ages))
{
print_r($element);
echo '
';
}
?>

Another printing method
Copy code The code is as follows:

$ages['Jack']=23;
$ ages['Lucy']=25;
$ages['Mark']=28;
while(!! ​​$element = each($ages))
{
echo $element[' key'].'=>'.$element['value'];
echo '
';
}
?>

6. Use of the list() function - assign the values ​​in the array to some variables
Copy the code The code is as follows:

< ;?php
$ages['Jack']=23;
$ages['Lucy']=25;
$ages['Mark']=28;
list($name, $age)= each($ages);
echo $name.'=>'.$age;
?>

Use list loop to print the results
Copy code The code is as follows:

$ages['Jack']=23;
$ages ['Lucy']=25;
$ages['Mark']=28;
while(!!list($name,$age)= each($ages))
{
echo $name.'=>'.$age.'
';
}
?>

output
Jack=>23
Lucy=>25
Mark=>28
7. Use of reset() function--point the internal pointer of the array to the first unit
Copy Code The code is as follows:

$ages['Jack']=23;
$ages['Lucy']=25;
$ages['Mark']=28;
each($ages);
each($ages);
list($name,$age)= each($ages);
echo $name.'=>'.$age.'
';
//Reset the array to the beginning of the array
reset($ages);
list($ name,$age)= each($ages);
echo $name.'=>'.$age.'
';
?>

Output
Mark=>28
Jack=>23
8. array_unique() -- Remove duplicate values ​​in the array
Copy code The code is as follows:

$nums = array(1,2,3,4,5,6,5,4,3,2,1, 1,2,3,4,5,6);
//Return an array that does not contain duplicate values
$result = array_unique($nums);
print_r($result);
?>
Output
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 )
9. array_flip ()-- Swap the keys and values ​​in the array
$userages = array('Jack'=> 23,'Lucy'=> ;25,'Mark'=>28);
$ages = array_flip($userages);
print_r($ages);
?>

output
Array ( [23] => Jack [25] => Lucy [28] => Mark )
3. The array
in the array is not necessarily a list of keywords and values. You can also put the array
in the array. Copy the code . The code is as follows:

$produces = array(
array('apple',6,28.8),
array('pear',3,15.6),
array('banana',10,4.6)
);
echo $produces[0][0].'|'.$produces[0][1].'|'.$produces[ 0][2].'
';
echo $produces[1][0].'|'.$produces[1][1].'|'.$produces[1][2 ].'
';
echo $produces[2][0].'|'.$produces[2][1].'|'.$produces[2][2].'< ;br>';
?>

output
apple|6|28.8
pear|3|15.6
banana|10|4.6
Use for Loop to print the array within the array
Copy code The code is as follows:

$produces = array (
array ('apple', 6, 28.8 ),
array ('pear', 3, 15.6 ),
array ('banana', 10, 4.6 )
);
for ($i = 0; $i {
for($j = 0; $j {
echo '|' . $produces[$i][$j];
}
echo '
';
}
? >

output
|apple|6|28.8
|pear|3|15.6
|banana|10|4.6
Two-dimensional array
Copy code The code is as follows:

$produces = array (
array ('name' => 'apple', 'amount' => 6, 'price' => 28.8 ),
array ('name' => 'pear', 'amount' => 3, 'price' => 15.6 ),
array ('name' => 'banana', 'amount' => 10, 'price' => 4.6 )
);
while(!!List($key ,$value)=each($produces))
{
while(!!list($key2,$value2)=each($value))
{
echo '|'.$ key2.'=>'.$value2;
}
echo '
';
}
?>

output
| name=>apple|amount=>6|price=>28.8
|name=>pear|amount=>3|price=>15.6
|name=>banana|amount= >10|price=>4.6
It is easier to print with foreach (recommended)
Copy the code The code is as follows:

$produces = array (
array ('name' => 'apple', 'amount' => 6, 'price' => 28.8 ),
array ('name' => 'pear', 'amount' => 3, 'price' => 15.6 ),
array ('name' => 'banana', 'amount' => ; 10, 'price' => 4.6 )
);
foreach($produces as $key1 => $value1)
{
foreach($value1 as $key2 => $ value2)
{
echo '|'.$key2.'=>'.$value2;
}
echo '
';
}
?> ;

output
|name=>apple|amount=>6|price=>28.8
|name=>pear|amount=>3|price= >15.6
|name=>banana|amount=>10|price=>4.6
IV. Sorting of arrays
1. Sort of English by the Sort() function
Copy code The code is as follows:


$fruits = array('lemo','banana',' apple','pear');
echo 'Original array:';
print_r($fruits);
echo '
';
sort($fruits);
echo 'Sorted array:';
print_r($fruits);
?>

output
Original array: Array ( [0] = > lemo [1] => banana [2] => apple [3] => pear )
Sorted array: Array ( [0] => apple [1] => banana [ 2] => lemo [3] => pear )
2.Sort() function to sort Chinese
Copy code The code is as follows:


$fruits = array('lemon','banana','apple','pear');
echo 'Original array:';
print_r($fruits);
echo '
';
sort($fruits);
echo 'Sorted array:';
print_r($fruits);
?>

Output:
Original array: Array ([0] => lemon[1] => banana[2] => apple[3] => pear)
sorted array :Array ([0] => Lemon[1] => Pear[2] => Apple[3] => Banana)
3. asort -- Sort the array and maintain the index relationship
Copy code The code is as follows:


$fruits = array('a'=>'Lemon','b'=>'Banana','c'=>' Apple','d'=>'Pear');
echo 'Original array:';
print_r($fruits);
echo '
';
asort($fruits);
echo 'Sorted array:';
print_r($fruits);
?>

output
Original array: Array ([a] => lemon[b] => banana[c] => apple[d] => pear)
Sorted array: Array ([a] => lemon[d] ] => Pear[c] => Apple[b] => Banana)
4. ksort -- Sort the array by key name
Copy code The code is as follows:


php
$fruits = array('b'=>'Lemon','a'=>'Banana','d'=>'Apple','c'=>'Pear');
echo 'Original array:';
print_r($fruits);
echo '
';
ksort($fruits);
echo 'Sorted Array: ';
print_r($fruits);
?>

output
Original array: Array ([b] => lemon[a] => ; Banana[d] => Apple[c] => Pear)
Sorted array: Array ( [a] => Banana[b] => Lemon[c] => Pear[d ] => Apple)
5. rsort -- Reverse sort the array
Copy code The code is as follows:


$fruits = array('Lemon','Banana' ,'apple','pear');
echo 'Original array:';
print_r($fruits);
echo '
';
rsort($fruits );
echo 'Sorted array:';
print_r($fruits);
?>

output
Original array: Array ( [0 ] => Lemon[1] => Banana[2] => Apple[3] => Pear)
Sorted array: Array ( [0] => Banana[1] => Apple[2] => Pear[3] => Lemon)
6. arsort -- Sort the array in reverse and maintain the index relationship
Copy code The code is as follows:


$fruits = array('a'=>'Lemon','b'=>'Banana','c'=>'Apple','d'=>'Pear');
echo 'Original array:';
print_r($fruits);
echo '
';
arsort($fruits);
echo 'Sorted array :';
print_r($fruits);
?>

output
Original array: Array ([a] => Lemon[b] => Banana[c] => Apple[d] => Pear)
Sorted array: Array ( [b] => Banana[c] => Apple[d] => Pear[a] => Lemon)
7. krsort -- Sort the array in reverse order by key name
Copy the code The code is as follows:


$fruits = array('a'=> ;'Lemon','b'=>'Banana','c'=>'Apple','d'=>'Pear');
echo 'Original array:';
print_r($fruits);
echo '
';
krsort($fruits);
echo 'Sorted array:';
print_r($fruits);
?>

output
Original array: Array ([a] => lemon[b] => banana[c] => apple[d] => ; Pear)
Sorted array: Array ( [d] => Pear[c] => Apple[b] => Banana[a] => Lemon)
8. shuffle -- Shuffle the array
Copy the code The code is as follows:


$fruits = array(' a'=>'Lemon','b'=>'Banana','c'=>'Apple','d'=>'Pear');
echo 'Original array:' ;
print_r($fruits);
echo '
';
shuffle($fruits);
echo 'Shuffled array:';
print_r( $fruits);
?>

output
Original array: Array ( [a] => Lemon[b] => Banana[c] => Apple [d] => Pear)
Shuffled array: Array ( [0] => Banana[1] => Apple[2] => Lemon[3] => Pear)
9. array_reverse -- Returns an array with the cells in reverse order
Copy code The code is as follows:


$fruits = array('a'=>'Lemon','b '=>'Banana','c'=>'Apple','d'=>'Pear');
echo 'Original array:';
print_r($fruits);
echo '
';
$fruits = array_reverse($fruits);
echo 'Reversed array:';
print_r($fruits);
? >

output
Original array: Array ([a] => lemon[b] => banana[c] => apple[d] => pear)
Reversed array: Array ([d] => Pear[c] => Apple[b] => Banana[a] => Lemon)
10. array_unshift -- in array Insert one or more units at the beginning
Copy code The code is as follows:


$fruits = array('a'=>'Lemon','b'=>'Banana ','c'=>'Apple','d'=>'Pear');
echo 'Original array:';
print_r($fruits);
echo '';
array_unshift($fruits,'杮子');
echo 'Array after insertion:';
print_r($fruits);
?>

output
Original array: Array ([a] => Lemon[b] => Banana[c] => Apple[d] => Pear)
After insertion Array: Array ([0] => 杮子[a] => lemon[b] => banana[c] => apple[d] => pear)
11. array_shift -- Move the unit at the beginning of the array out of the array
Copy code The code is as follows:


$fruits = array('a'=>'Lemon','b'=>'Banana ','c'=>'Apple','d'=>'Pear');
echo 'Original array:';
print_r($fruits);
echo '';
array_shift($fruits);
echo 'Array after shifting:';
print_r($fruits);
?>

output
Original array: Array ([a] => lemon[b] => banana[c] => apple[d] => pear)
The moved array: Array ( [b] => Banana [c] => Apple [d] => Pear)
12. array_rand -- Randomly remove one or more units from the array
Copy code The code is as follows:


$fruits = array ('Lemon', 'Banana', 'Apple', 'Pear' );
echo 'Original array:';
print_r ( $fruits );
echo '
';
$newArr_key = array_rand ( $fruits, 2 );
echo 'Array after randomization:';
echo $fruits [$newArr_key [0]].' ';
echo $fruits [$newArr_key [1]];
?>

output
Original array: Array ( [0] => Lemon[1] => Banana[2] => Apple[3] => Pear)
Random array: pear apple
13. array_pop -- Pop the last unit of the array (Pop)
Copy code The code is as follows:


$fruits = array ('lemon', 'banana', 'apple', 'pear' );
echo 'Original array:';
print_r ( $fruits );
echo '
';
array_pop ( $fruits );
echo 'Array after popping:';
print_r ( $fruits );
?>

Output:
Original array: Array ([0] => Lemon[1] => Banana[2] => Apple[3] => Pear)
Array after popping :Array ([0] => Lemon[1] => Banana[2] => Apple)
14. array_push -- Push one or more cells to the end of the array (push)
Copy code The code is as follows:


$fruits = array ('Lemon', 'Banana', 'Apple', 'Pear' );
echo 'Original array:' ;
print_r ( $fruits );
echo '
';
array_push ( $fruits,'杮子');
echo 'Array after popping:';
print_r ( $fruits );
?>

Output:
Original array: Array ( [0] => Lemon[1] => Banana[2 ] => Apple[3] => Pear)
Array after popping up: Array ([0] => Lemon[1] => Banana[2] => Apple[3] => Pear[4] => 杮子)
5. Array pointer operations
each -- Returns the current key/value pair in the array and moves the array pointer forward one step
current -- Returns the current unit in the array
reset -- Moves the internals of the array The pointer points to the first unit
end -- points the internal pointer of the array to the last unit
next -- moves the internal pointer in the array forward one bit
pos -- alias of current()
prev -- Rewind the internal pointer of the array by one bit

Copy code The code is as follows:

$fruits = array ('lemons', 'banana', 'apple' , 'Pear' );
print_r ( $fruits );
echo '
';
echo 'each() : ';
print_r ( each ( $fruits ) ) ;
echo '
';
echo 'current() : ';
echo (current ( $fruits ));
echo '
';
echo 'next() : ';
echo (next ( $fruits ));
echo '
';
echo 'end() : ';
echo (end ( $fruits ));
echo '
';
echo 'prev() : ';
echo (prev ( $fruits ));
echo '
';
echo 'pos() : ';
echo (pos ( $fruits ));
echo '
';
?>

Output:
Array ( [0] => Lemon[1] => Banana[2] => Apple[3] => Pear)
each( ) : Array ( [1] => lemon[value] => lemon[0] => 0 [key] => 0 )
current() : banana
next() : apple
end() : Pear
prev() : Apple
pos() : Apple
6. Count the number of arrays
count -- Count the number of cells in the array or the number of attributes in the object
sizeof -- Alias ​​of count()
array_count_values ​​-- Count the number of occurrences of all values ​​in the array
Copy code The code is as follows:

$nums = array (1, 3, 5, 1 , 3, 4, 5, 65, 4, 2, 2, 1, 4, 4, 1, 1, 4, 1, 5, 4, 5, 4 );
echo count ( $nums );
echo '
';
echo sizeof ( $nums );
echo '
';
$arrayCount = array_count_values ​​( $nums );
print_r ( $arrayCount ) ;
?>

output
22
22
Array ( [1] => 6 [3] => 2 [5] => 4 [4] => 7 [65] => 1 [2] => 2 )
Seven. Convert the array into a scalar variable: extract()
Convert each element in the array into a variable. The variable name is the key of the array element, and the variable value is the value of the array element.
Copy code The code is as follows:

$fruits = array('a'=>'apple','b'=> 'banana','o'=>'orange');
extract($fruits);
echo $a.'
';
echo $b.'
';
echo $o.'
';
?>

output
apple
banana
orange

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/324807.htmlTechArticle1. What is an Array? An array is a set of elements that share certain characteristics, including similarity and type. Each element is distinguished by a special identifier, called a key, and each key has a...
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
How does PHP type hinting work, including scalar types, return types, union types, and nullable types?How does PHP type hinting work, including scalar types, return types, union types, and nullable types?Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

How does PHP handle object cloning (clone keyword) and the __clone magic method?How does PHP handle object cloning (clone keyword) and the __clone magic method?Apr 17, 2025 am 12:24 AM

In PHP, use the clone keyword to create a copy of the object and customize the cloning behavior through the \_\_clone magic method. 1. Use the clone keyword to make a shallow copy, cloning the object's properties but not the object's properties. 2. The \_\_clone method can deeply copy nested objects to avoid shallow copying problems. 3. Pay attention to avoid circular references and performance problems in cloning, and optimize cloning operations to improve efficiency.

PHP vs. Python: Use Cases and ApplicationsPHP vs. Python: Use Cases and ApplicationsApr 17, 2025 am 12:23 AM

PHP is suitable for web development and content management systems, and Python is suitable for data science, machine learning and automation scripts. 1.PHP performs well in building fast and scalable websites and applications and is commonly used in CMS such as WordPress. 2. Python has performed outstandingly in the fields of data science and machine learning, with rich libraries such as NumPy and TensorFlow.

Describe different HTTP caching headers (e.g., Cache-Control, ETag, Last-Modified).Describe different HTTP caching headers (e.g., Cache-Control, ETag, Last-Modified).Apr 17, 2025 am 12:22 AM

Key players in HTTP cache headers include Cache-Control, ETag, and Last-Modified. 1.Cache-Control is used to control caching policies. Example: Cache-Control:max-age=3600,public. 2. ETag verifies resource changes through unique identifiers, example: ETag: "686897696a7c876b7e". 3.Last-Modified indicates the resource's last modification time, example: Last-Modified:Wed,21Oct201507:28:00GMT.

Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1?Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1?Apr 17, 2025 am 12:06 AM

In PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values ​​to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.

PHP: An Introduction to the Server-Side Scripting LanguagePHP: An Introduction to the Server-Side Scripting LanguageApr 16, 2025 am 12:18 AM

PHP is a server-side scripting language used for dynamic web development and server-side applications. 1.PHP is an interpreted language that does not require compilation and is suitable for rapid development. 2. PHP code is embedded in HTML, making it easy to develop web pages. 3. PHP processes server-side logic, generates HTML output, and supports user interaction and data processing. 4. PHP can interact with the database, process form submission, and execute server-side tasks.

PHP and the Web: Exploring its Long-Term ImpactPHP and the Web: Exploring its Long-Term ImpactApr 16, 2025 am 12:17 AM

PHP has shaped the network over the past few decades and will continue to play an important role in web development. 1) PHP originated in 1994 and has become the first choice for developers due to its ease of use and seamless integration with MySQL. 2) Its core functions include generating dynamic content and integrating with the database, allowing the website to be updated in real time and displayed in personalized manner. 3) The wide application and ecosystem of PHP have driven its long-term impact, but it also faces version updates and security challenges. 4) Performance improvements in recent years, such as the release of PHP7, enable it to compete with modern languages. 5) In the future, PHP needs to deal with new challenges such as containerization and microservices, but its flexibility and active community make it adaptable.

Why Use PHP? Advantages and Benefits ExplainedWhy Use PHP? Advantages and Benefits ExplainedApr 16, 2025 am 12:16 AM

The core benefits of PHP include ease of learning, strong web development support, rich libraries and frameworks, high performance and scalability, cross-platform compatibility, and cost-effectiveness. 1) Easy to learn and use, suitable for beginners; 2) Good integration with web servers and supports multiple databases; 3) Have powerful frameworks such as Laravel; 4) High performance can be achieved through optimization; 5) Support multiple operating systems; 6) Open source to reduce development costs.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool