in reply to Change a String's Element
You can accomplish what you want by
substr($packet,0,1) = "X"; [download]
Syntactic sugar causes cancer of the semicolon. --Alan Perlis