[PHP] - operator and :: (formal names?)

2004-07-26 Thread Katie Marquez
Hi!

I did a search of the PHP manual for these:

- and ::

I know what they are used for, but what I don't know
is what they are formally called.  Can someone tell me
what they are called (short of using the symbol in the
name)?

The PHP manual's search engine returns me (among
others)the Chapter 10: Operators page , but I didn't
see the symbols listed there.  I also checked the
section for chapters 13 and 14 classes and object
and did find the :: listed, but it does not give the
name of the symbol.  A search of Google with keywords
- or :: comes back empty.

Thanks,
K.



__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] making changes on arrays

2004-04-29 Thread Katie Marquez
I'm practicing from a beginning PHP book regarding
arrays and the PHP manual, so please no one flame me
that I didn't try to research before posting.  I'm
thinking that what I want to do requires me to use the
function array_walk or a foreach loop, but I'm not so
sure so maybe someone help here can help.

I want to have an array, perform an action on the
values in the array, and have those actions
permanently affect the values in the array.  Here's
something I've written to test it out how I thought it
could be done:

?php
$array = ('zero\0', 'one\1', 'two\2', 'three\3');
// look at array before changes
print_r($array);
// maybe use foreach or array_walk next?
foreach ($array as $value)
{
 stripslashes($value);
}
// look at array after changes
print_r($array);
?

I'm guessing by now someone can see my error, but I
don't know enough programming to spot it.  What I
thought would happen is my values would have the
backslash removed in the second print_r().  What I
would want is for any changes made in the array
(meaning my values) to be permanent in the array
afterwards.  If I can accomplish the code above, I
figure I can create my own functions to affect changes
on values or at least better understand what I'm
looking at in other people's examples/comments at the
online PHP manual.

Thank you in advance.

Katie




__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] making changes on arrays (SOLVED)

2004-04-29 Thread Katie Marquez
Very cool, Travis!  Thank you for answering so
quickly!  You guys work fast around here :)

Katie

--- Travis Low [EMAIL PROTECTED] wrote:
 Hi Katie,
 
 The foreach construct operates on copies of the
 array values.  I usually just 
 stick to C-like syntax:
 
 for( $i = 0; $i  count( $array ); $i++ )
 {
  $array[$i] = doSomething( $array[$i] );
 }
 
 cheers,
 
 Travis
 





__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php