有没有办法逃避“。” php 中的字符?

Is there a way to escape the "." character in php?

我有一个 stdClass 对象,它是我使用 json_decode() 从 JSON 动态创建的。我正在尝试通过调用 $value->V.X->processedField 来访问字段 但是这个领域有一个时期。这给我一个语法错误。有没有办法以某种方式在我的代码中转义句点,或者我是否必须重命名 JSON 中的字段?

<?php
// example code

$value = json_decode('{"V.X": {"processedField":"the value"}}');
print_r($value->{"V.X"}->processedField);
// or 
$var = "V.X";
print_r($value->$var->processedField);