Atheer
Atheer

Reputation: 921

echo/print specific element

i tried this example on ajax here

and i wonder if i can echo/print a specific element of the array at the php side
let's say i just want to print the second element which is "lastName"
i tried echo $t2lpostData[1]
it gives me error
"Undefined offset: 1 in C:\wamp\www\thank-you.php on line 12"

help plz,,

Upvotes: 0

Views: 124

Answers (1)

Daniel DiPaolo
Daniel DiPaolo

Reputation: 56408

echo $t2lpostData["lastName"]

You have to access it by name instead of index.

Upvotes: 1

Related Questions