Skip to content

Instantly share code, notes, and snippets.

@hikari-no-yume
Created August 8, 2022 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hikari-no-yume/9f726970c7d8eb9f50b08a013ef57f3a to your computer and use it in GitHub Desktop.
Save hikari-no-yume/9f726970c7d8eb9f50b08a013ef57f3a to your computer and use it in GitHub Desktop.
PHP string method aliases concept
addcslashes
addslashes
bin2hex | $str->hexToBytes()
chr | string::fromByteValue()
chunk_split | $str->byteChunks()
convert_uudecode
convert_uuencode
count_chars | $str->countBytesWithValue()
crc32
crypt
echo
explode | $str->split()
fprintf
get_html_translation_table
hebrev
hex2bin | $str->bytesToHex()
html_entity_decode | $str->decodeHTMLEntities()
htmlentities | $str->encodeHTMLEntities()
htmlspecialchars_decode | $str->decodeHTMLSpecialChars()
htmlspecialchars | $str->encodeHTMLSpecialChars()
implode, join | $str->join()
lcfirst | $str->toLowerFirstLocale()
levenshtein
localeconv
ltrim | $str->trimLeftASCII()
md5_file
md5
metaphone
money_format
nl_langinfo
nl2br | $str->newlinesToBrTags()
number_format
ord | $str->toByteValue()
parse_str
print
printf
quoted_printable_decode
quoted_printable_encode
quotemeta
rtrim, chop | $str->trimRightASCII()
setlocale
sha1_file
sha1
similar_text
soundex
sprintf
sscanf
str_contains | $str->contains()
str_ends_with | $str->endsWith()
str_getcsv
str_ireplace | $str->replaceIgnoreCaseLocale()
str_pad | $str->pad()
str_repeat | $str->repeat()
str_replace | $str->replace()
str_rot13
str_shuffle | $str->shuffle()
str_split | $str->splitOnWhitespaceASCII()
str_starts_with | $str->startsWith()
str_word_count | $str->countWordsASCII()
strcasecmp | $str->compareIgnoreCaseASCII()
strchr | $str->findByte()
strcmp | $str->compare()
strcoll | $str->compareCollationLocale()
strcspn | $str->span()
strip_tags
stripcslashes
stripos | $str->findIgnoreCaseLocale()
stripslashes
stristr | ? (too similar to strstr/strpos)
strlen | $str->byteCount
strnatcasecmp | $str->compareIgnoreCaseNaturalLocale()
strnatcmp | $str->compareNaturalLocale()
strncasecmp | $str->comparePrefixIgnoreCaseASCII()
strncmp | $str->comparePrefix()
strpbrk | ? (too similar to strspn)
strpos | $str->find()
strrchr | $str->findByteFromEnd()
strrev | $str->reverse()
strripos | $str->findFromEndIgnoreCaseLocale()
strrpos | $str->findFromEnd()
strspn | $str->spanFromEnd()
strstr | ? (to similar to strpos)
strtok
strtolower | $str->toLowerLocale()
strtoupper | $str->toUpperLocale()
strtr | $str->replaceByteRanges()
substr_compare | ? (too similar to strcmp)
substr_count | ?
substr_replace | ? (too similar to replace)
substr | $str->substr()
trim | $str->trimASCII()
ucfirst | $str->toUpperFirstLocale()
ucwords | $str->toUpperWordsLocale()
utf8_decode
utf8_encode
vfprintf
vprintf
vsprintf
wordwrap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment