|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2003-03-26 04:34 UTC] jorgen at webstores dot nl
 <?php
  $var = 'ABC';
  echo ($var[0]); // Displays 'A'
  echo ($var[1]); // Displays 'B'
  echo ($var[2]); // Displays 'C'
  echo join(" ", $var); // Wont work
?>
Do you get my point? One can call a 'string' variable as an Array, but one can not use that same 'string' as an Array parameter. Seems a little bit odd to me...
Because I want to display: 'ABC' as 'A B C', would this be very handy.
Kind regards,
Jorgen Horstink
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 19:00:02 2025 UTC | 
Your have mistaken two different meanings of [] operator which can mean both string offset (as is in your example) and array. For this reason the use of [] has been discouraged for some time and {} has been introduced as the replacement for the case of accessing string characters.