Reputation: 834
char *pointer = "Hello"; *pointer++;
Above code is in C language, What would be its equivalent PHP code?
Upvotes: 1
Views: 137
Reputation: 158250
There are no pointers in PHP. You can access several chars of a string using the [] operator. (manual) The following code might do what you need:
[]
$string = "Hello"; $position = 0; $char0 = $string[$position]; $char1 = $string[++$position];
Upvotes: 2