Ad
  • Custom User Avatar

    You can use less commands when making sure $char is not more than 255. Just use $char = ++$char % 256; -- this way it is shorter, cleaner and is only one command instead of if/else. Just an advice.

  • Custom User Avatar

    This is not real-world programming, so no need to check if the variable is empty or null. I don't understand why do people often do this in problems, I mean it is certain there won't be any error in input data, unless it is specified in the task. Remove this check and you have a lot shorter, cleaner and better solution. I didn't mean to abuse you, it's just a shout-out to everybody who does it.