You are here: syntax questions: curly syntax?, question mark uses? « All PHP « IT news, forums, messages
syntax questions: curly syntax?, question mark uses?

Posted by J on 02/16/06 17:59

I have two questions.

I was reading through the code at
http://www-128.ibm.com/developerworks/opensource/library/os-php-flexobj/

I'm looking for the section in the manual which explains my questions.. I
couldn't find it.

First, as I understand it curly syntax automatically converts arguments to
strings...
$book is a class (representing a table) with an array of $field items. The
constructor makes 'title' one of the array keys.
In the following, curly syntax seems to do the opposite.

$book->{'title'} = "PHP Hacks";

Is this any different from $book->fields['title'] = "..." ? I didn't see
anything on this in the arrays section or the curly syntax section of the
manual.

//Second question...

function insert()

{
global $db;

$fields = $this->table."_id, ";
$fields .= join( ", ", array_keys( $this->fields ) );

$inspoints = array( "0" );
foreach( array_keys( $this->fields ) as $field )
$inspoints []= "?";
$inspt = join( ", ", $inspoints );

Is this question mark thing a standard feature of associated for loops?
Where in the manual is it? You can imagine that searching for a question
mark in a php manual would be pretty stupid - hence, I tried it.

Thanks!

-J

 

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

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