Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how many chars???

Status
Not open for further replies.

ThomasJSmart

Programmer
Sep 16, 2002
634
how do i ask how many characters a variable has in php?

i need it to do sumthing like this

$var1 = happy

if ($var 1 [has 3 chars]){ echo"blablabla"; }else{echo"bla"}


thnx
 
Use the strlen function. It returns the length of the string. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top