PHP: How-To access accociative array with numeric index

$arr = array('a' => 'aaa', 'b' => 'bbb'); echo 'how to access accociative array with numeric index' . $arr[0]; ? associative arrays don't have numeric indeces so i need to convert it before? $blah = array_keys($arr); echo $blah[0]; should do it thanks or array_values() in fact that's probably more logical both in my case :) i try to modify the letter after a . to be uppercase, so i do $text = preg_replace_callback("/(\.|\?|!|;)([^\s]{1})/", create_function('$m', 'return "$m[1] " . strtoupper($m[2]);'), $text); it doesn't work, but i have use a common way, i put the name of a callback, now it works, i've done an error in the create_function(), but i don't see it, any idea? ahhh sorry, i've misunderstood, it works indeed :) $text = preg_replace('/(?< =[.?!;])\S/e', '\'$0\'&"\xDF"', $text); ugh, my farts smell like strong stilton I think I've managed ot disgust myself that's what newbies do newbie you say... rofl Action: apathy- adjusts his hat another newbie move? easy, tiger

 

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Leave a Comment

You must be logged in to post a comment.


Blog Tags:

Similar posts: