Run snippet A. Use &modx->setPlaceholder(’placeholder-name’, $value) to store whatever snippet A does that you want to use in snippet B.
If you just want to display the value, just use the placeholder [+placeholder-name+] in your HTML (template or document content).
Then in snippet B use $modx->getPlaceholder(’placeholder-name’) to retrieve the value from the placeholder array.
Just make sure that in your content snippet A is called (to set the placeholder) before snippet B.
You could also directly access the $modx->placeholders[’placeholder-name’] array if you want. I don’t think using the "getter" function adds all that much overhead, and in an object like the $modx object it’s more polite to use its setter and getter functions. The array itself could be defined as "private" and only the object itself can access it; in that case you would have to use the object’s setter and getter functions. So best not to get into bad habits
http://il.php.net/manual/en/language.oop5.visibility.php