--- id: php-arrays title: "PHP Arrays" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["PHP λ°°μ—΄ κ°œμš”"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.9 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["php", "programming", "w3schools", "arrays"] raw_sources: ["https://www.w3schools.com/php/php_arrays.asp"] applied_in: [] github_commit: "" --- # [[PHP Arrays]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) A single PHP array can freely mix data types AND nest other arrays inside it (`array("Volvo", 15, ["apples", "bananas"])`) β€” unlike strictly-typed array languages, PHP places no constraint on element type uniformity, treating arrays/objects/functions as equally valid array items alongside strings and numbers. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Array** β€” a special variable holding multiple values under one name, accessed by index or key. [S1] - **Three array types** β€” indexed (numeric index), associative (named keys), multidimensional (arrays of arrays). [S1] - **Mixed-type items** β€” an array can hold strings, numbers, objects, functions, or other arrays simultaneously. [S1] - **`count()`** β€” returns the number of items in an array. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Basic array: `$cars = array("Volvo", "BMW", "Toyota");`. [S1] - Mixed types with nested array: `$myArr = array("Volvo", 15, ["apples", "bananas"]);`. [S1] - Counting: `echo count($cars);`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ†ŒμŠ€μ—μ„œ λͺ¨μˆœλ˜λŠ” μ •λ³΄λŠ” λ°œκ²¬λ˜μ§€ μ•ŠμŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” μ„œλ‘œ λ‹€λ₯Έ 데이터 νƒ€μž…μ„ ν•˜λ‚˜μ˜ 배열에 μ„žμ–΄ μ €μž₯ν•˜λŠ” 것이 PHP λ°°μ—΄μ˜ μœ μ—°μ„±μ„ λ³΄μ—¬μ£ΌλŠ” λŒ€ν‘œ 사둀닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Array holding mixed data types including a nested array (PHP): ```php $myArr = array("Volvo", 15, ["apples", "bananas"]); ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.90 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[PHP Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[PHP Arrays Indexed]], [[PHP Arrays Associative]], [[PHP Arrays Multidimensional]] - **μ°Έμ‘° λ§₯락:** λ°°μ—΄ 전체 μ„Ήμ…˜μ˜ λ„μž…λΆ€ β€” 인덱슀 λ°°μ—΄(Indexed) μ±•ν„°λ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” PHP Arrays β€” https://www.w3schools.com/php/php_arrays.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "PHP Arrays" page (Astra wiki-curation, P-Reinforce v3.1 format).