₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,809 members, 8,513,799 topics. Date: Thursday, 05 November 2026 at 02:32 PM

Toggle theme

Php Quiz: And A Short Array Issue :: Copy Array Values Into Key - Webmasters - Nairaland

Nairaland Forum › Science/Technology › Webmasters › Php Quiz: And A Short Array Issue :: Copy Array Values Into Key (1301 Views)

1 Reply

Php Quiz: And A Short Array Issue :: Copy Array Values Into Key by Nobody: 5:53pm On Jul 27, 2011
I have an array that looks like this:

<?php
$babes=Array(0=>"Chichi",1=>"Chika",2=>"Chiamaka"wink;
?>
I want to convert it into:

$babes=Array("Chichi"=>"Chichi","Chika"=>"Chika","Chiamaka"=>"Chiamaka"wink;

What is the fastest way to do that? Note that the following commands are unacceptable:
- Foreach, while or other loops
- Array_keys / Array_Values
- Array_Flip - (why will you wanna flip the babes)
1 Reply

Why A Blogger Should Never Copy And Paste • Why Does This Mysql Query Display "array" Instead Of The Result • Getting The First Character Of Array Values, Php ? • 2 • 3 • 4

Designing A Responsive Layout From Scratch For Html5,wordpress,joomla,drupal • Do You Know Any Advertising Networks In Nigeria • Help A Fine Girl O