You are here: WHat kind of value is this? « All PHP « IT news, forums, messages
WHat kind of value is this?

Posted by Captain Dondo on 06/08/05 19:25

OK, I'm a complete PHP newbie. In fact, this is the first PHP project
I've taken on... I need to make some changes to an existing codebase
and add a couple of custom pages; nothing major. A good learning
project. I am familiar with C and Python...

I have a snippet of code that goes like this:

$ys_w = imgid.bigw.value + 50;
$ys_h = imgid.bigh.value + 50;
// $ys_h = gettype(imgid.bigw.value);

It appears that imgid.bigX.value is of type (string), but not quite....

The above operation concatenates 50 on the end of imgid.bigw.value, so
that the end result is 64050, not 690 as I want.... The way I
understand PHP (which is not at all), there should be automatic
typecasting to (int) for the addition.

I've tried to figure out what type imgid.bigw.value is, but using the
gettype function simply makes the snippet fail.... Nothing shows up in
my apache logs, but no code is produced if I remove the comment....

Sorry for the spotty information; I can't even figure out how imgid is
being created in the code, let alone figure out what type it is... (I'm
guessing that it's some sort of object (maybe)?

I've tried various abominations like

(string) ((int)imgid.bigw.value + 50)

but again, that makes the code fail silently. In fact, trying to
tpyecast imgid.bigw.value makes the code fail.....

So... Where do I begin? This should be simple, but I have read the docs
on Codewalkers, googled about, and still don't have a clue....

 

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

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