logo

internet.com
Join the free
WDVL newsletter!

home

Finding the length of a scalar variable with the length function

Finding the length of a scalar variable with the length function

  • Finding the length of a scalar variable is incredibly easy using the length function. The syntax of length is as follows:

    length ([$variable_name]); 
    

  • Thus, if the scalar variable $name equals "Selena", then the scalar variable $length_of_name will be assigned the value of six in the following line:

    $length_of_name = length ($name); 
    

Cropping scalar variables with the chop function
Table of Contents
Manipulating substrings with the substr function

Up to => Home / Authoring / Scripting / Tutorial

Instantly look up a "techie" word using Webopedia!!


internet.com
e-commerce
WebDeveloper Network


Live coverage of Fall Internet World '99!

Copyright 1999 internet.com Corporation. Legal Notices. Privacy Policy.

www.internet.com