--- id: php-echo-print title: "PHP Echo Print" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["echo vs print", "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", "echo", "print"] raw_sources: ["https://www.w3schools.com/php/php_echo_print.asp"] applied_in: [] github_commit: "" --- # [[PHP Echo Print]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) `print` returns 1 (usable inside expressions) while `echo` returns nothing at all β€” this is the functional difference behind an otherwise near-identical pair of output statements, alongside echo accepting multiple comma-separated arguments where print accepts exactly one. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`echo`** β€” no return value; accepts multiple parameters; marginally faster than print. [S1] - **`print`** β€” returns 1 (usable in expressions); accepts only one argument. [S1] - **Both optional-parens** β€” `echo "x";` / `echo("x");` and `print "x";` / `print("x");` are equivalent. [S1] - **Double vs. single quotes** β€” double quotes allow direct variable interpolation (`"$txt"`); single quotes require concatenation (`'...' . $txt . '...'`). [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - echo with multiple params: `echo "This ", "string ", "was ", "made ", "with multiple parameters.";`. [S1] - Double-quote interpolation: `echo "

$txt1

";`. [S1] - Single-quote concatenation: `echo '

' . $txt1 . '

';`. [S1] - print (single arg only): `print "Hello world!
";`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - **λ°˜ν™˜κ°’ 차이**: echoλŠ” λ°˜ν™˜κ°’μ΄ μ—†κ³ , printλŠ” 1을 λ°˜ν™˜ν•˜μ—¬ ν‘œν˜„μ‹ λ‚΄μ—μ„œ μ‚¬μš© κ°€λŠ₯ν•˜λ‹€λŠ” 점이 핡심 차이둜 λͺ…μ‹œλ¨. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” μ—¬λŸ¬ λ¬Έμžμ—΄μ„ 콀마둜 λ‚˜μ—΄ν•΄ ν•œ λ²ˆμ— 좜λ ₯ν•˜λŠ” echo의 닀쀑 인자 κΈ°λŠ₯이 μ‹€μ „μ—μ„œ 자주 쓰인닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) echo with multiple comma-separated arguments (PHP): ```php echo "This ", "string ", "was ", "made ", "with multiple parameters."; ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.90 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[PHP Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[PHP Variables]], [[PHP Data Types]], [[PHP String Concatenate]] - **μ°Έμ‘° λ§₯락:** 좜λ ₯의 두 κ°€μ§€ 방법 β€” 데이터 νƒ€μž…(Data Types) μ±•ν„°λ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” PHP echo and print Functions β€” https://www.w3schools.com/php/php_echo_print.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "PHP echo and print" page (Astra wiki-curation, P-Reinforce v3.1 format).