0

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..

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by diafol
0

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.

Edited by diafol: n/a

0

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..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.