FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How can i get value of text area?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How can i get value of text area? [message #182110 is a reply to message #182093] Wed, 10 July 2013 20:25 Go to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
sanjayrathod273(at)gmail(dot)com wrote:

> i have two files
> 1)index.php
> and
> 2)code.js

No, you have copied them from <http://web.guru99.com/data-types-variables-and-operators/> without telling us (or them).

You cannot simply copy the client-side code from a PHP-powered Web site
(they are using WordPress, but the editor makes it clear already) and expect
it to work the same at your box. Also, you MUST NOT do that (except perhaps
for non-public use; check your local Copyright laws – IANAL).

But any Web site that makes claims like

| PHP is a loosely typed language; it does not have explicit defined data
| types.
|
| PHP determines the data types by analyzing the attributes of data
| supplied.
|
| PHP implicitly supports the following data types […]

is not to be trusted anyway.

PHP is _not_ a “loosely typed” language (that term is “loosely *defined*”
itself; avoid it). It is a language with dynamic type-checking (at runtime,
as opposed to static type-checking at compile-time).

That means it *has* “explicit defined data types”, but that symbols
(variables, array member, classes, properties) do not have a type as in “is
declared as” or “enforce” (at *compile time*), and that *values* have a type
instead. The type of the symbol is defined by the value it stores or refers
to, at *runtime*. In some cases, as with type hinting and setters/getters,
more strict type-checking or implicit type conversion, can be enforced on
function parameters and properties. As such, PHP without type hinting can
be called a “weakly typed” language according to Liskov and Zilles, and
Jackson (referred in [1]).

Data types are supported in PHP *explicitly*. Each PHP value has a type in
the Zend2 PHP engine:

<http://www.php.net/manual/en/internals2.variables.intro.php> etc.

So the gettype() function does _not_ “[analyze] the attributes of data
supplied”, it just reads the “type” member of the zval and maps it to a
human-readable string value.

As with other languages with dynamic type-checking (such as ECMAScript
implementations like JavaScript, for a prominent example), implicit type
*conversion* (in PHP also called “type juggling”) is performed with certain
operators:

<http://www.php.net/manual/en/language.types.php>

You are better off reading <http://php.net/manual>, asking specific
questions in this newsgroup, or taking a PHP class at Zend.com than reading
this tutorial. And you will learn more about PHP by setting it up on your
computer than by using a Web editor.


PointedEars
___________
[1] <http://en.wikipedia.org/wiki/Strong_and_weak_typing>
--
When all you know is jQuery, every problem looks $(olvable).
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help with Security Have I coded this correctly?
Next Topic: PHPMailer from and mesg-id bug
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 16:19:49 GMT 2024

Total time taken to generate the page: 0.04701 seconds