Search code examples
phpsyntaxpropertiesxml-namespaces

Colon not allowed on PHP


I want to navigate with this path:

$make = $entry->ad:vehicle->ad:make->resource:local-description;

But ":" are not allowed, how can i use ":" without any error?


Solution

  • You could use a qualifier like this:

    $make = $entry->{"ad:vehicle"}->{"ad:make"}->{"resource:local-description"};