You are here: Re: break apart a variable « PHP Programming Language « IT news, forums, messages
Re: break apart a variable

Posted by Jerry Stuckle on 02/07/07 16:36

Auddog wrote:
> I would like to know how I can break apart a variable. I'm currently
> passing the variable $id-hours and I would like to break it down. I would
> like to break down to something similar to:
>
> $eid = id (id part of $id-hours)
> $ehour = hours (hours part of $id-hours)
>
> Is this possible? I'm new to programming and just trying to get thru it
> all. Thanks for any help that you may be able to provide.
>
> A
>
>

Not easily. When you pass a variable to a function the name of the
variable changes.

But why would you need to, anyway? Variable names are just there for
human readability; they should be meaningful to the programmer, but the
computer doesn't care.

And BTW - $id-hours is an invalid variable name. The hyphen isn't valid
in a variable name.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация