Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
PHP
get only the first two word from a string php
KLC
Programming language:
PHP
2021-06-13 21:37:47
0
Q:
get only the first two word from a string php
Ana Clara Carvalho
Code:
PHP
2021-05-27 22:20:00
$message = preg_split('/[\s,]+/', $message, 3)
0
Tags
string
get
php
two
first
word
Related
get the last comma position of string in php
php get first 5 characters of string
php get only numbers from string
php keep only numbers in string
get last character of string php
print only some characters of a string in php
only display part of string php
php ucfirst all words
php keep only digitts
php get first digit of number
php string cut first x characters
php find if substring is in string
get words after string in in php
php get first character of string
first letter capital of every word in php
get the string after a character in php
php find multiple strings in string
php count words in a string
php pop off the first character of string
New to Communities?
Join the community