hi all,

i have an array like this one

Array
(
    Array
        (
            [0] => Array
                (
                    [id] => 12
                    [name] => praveen
                )

            [1] => Array
                (
                    [id] => 14
                    [name] => pandu
                )

            [2] => Array
                (
                    [id] => 16
                    [name] => phani
                )

and i have database where some of the values will be same as this array but names will be different or maybe database may contain some extra names too...

for example if database contains these values
name: karthik
id: 25

name:sandeep
id:10

name: phani
id: 33

name: praveen
id:98

then i want an array like this one

Array
(
    Array
        (
            [0] => Array
                (
                    [id] => 12-98
                    [name] => praveen
                )

            [1] => Array
                (
                    [id] => 14
                    [name] => pandu
                )

            [2] => Array
                (
                    [id] => 16-33
                    [name] => phani
                )

 [3] => Array
                (
                    [id] => 10
                    [name] => sandeep
                )
[4] => Array
                (
                    [id] => 25
                    [name] => karthik
                )

so that i can send two id s to different tables to evaluate...
can anyone help me out..

Member Avatar for diafol

why not have a second id key like id2?

[0] => Array
                (
                    [id] => 12
                    [id2] => 98
                    [name] => praveen
                )

etc.

There again, I don't really understand what you're trying to do.

why not have a second id key like id2?

[0] => Array
                (
                    [id] => 12
                    [id2] => 98
                    [name] => praveen
                )

etc.

There again, I don't really understand what you're trying to do.

hi thanks for the reply...
the first array comes from webservice and so i need to separate webservice names and my database names..so that i can re send the names with webservice ids to webservice and names with database ids to database..

Member Avatar for diafol

sorry, that doesn't make any sense to me. What do you need to do - combine arrays?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.