Python Error Indexerror Invalid Index To Scalar Variable Php