Decrement character with php

前端 未结 5 943
盖世英雄少女心
盖世英雄少女心 2021-01-12 01:15

Why is it that it\'s ok to increment character but not decrement with PHP?

PHP



        
5条回答
  •  醉梦人生
    2021-01-12 01:40

    Simple function you can achieve it:

    function decrementChar($Alphabet) {
    return chr(ord($Alphabet) - 1);
    }
    

提交回复
热议问题