如何显示数据ID,名称?

My file xml:

    <pasaz:Envelope>
<pasaz:Body>
<loadOffe>
<offe>
<off>
<id>120023</id>
<name>my name John</name>
<name>Test</name>
</off>
</offe>
</loadOffe>
</pasaz:Body>
</pasaz:Envelope>

How to view a php (id and name).

If you're just looking for a simple way to extract the contents of a tag, but don't want to go to all the trouble of parsing the XML properly, you could do something like this:

$xml = ""; // your xml data as a string
function get_tag_contents($xml, $tagName) {
    $startPosition = strpos($xml, "<" . $tagName . ">");
    $endPosition = strpos($xml, "</" . $tagName . ">");
    $length = $endPosition - ($startPosition + 1);
    return substr($xml, $startPosition, $length);
}

$id = get_tag_contents($xml, "id");
$name = get_tag_contents($xml, "name");

This assumes you haven't assigned any attributes to your tags, and that each tag is unique (in the example you gave us I noted two "name" tags, and if you want both you'll need to make this solution a bit more robust or do proper XML parsing).

As Marc B suggested in his comment you should use DOM, either use getElementsByTagName() or DOMXPath, example for getElementaByTagName():

$dom = new DOMDocument;
$dom->loadXML($xml);
$ids = $dom->getElementsByTagName('id');
if( $ids || !$ids->length){
    throw new Exception( 'Id not found');
}
return $ids->item(0);

How to get all items? Example (does not work ..)

$pliks = simplexml_load_file("file.xml"); 
foreach ($pliks->children('pasaz', true) as $body)
{
foreach ($body->children() as $loadOffe)
{
if ($loadOffe->offe->off) {
echo "<p>id: $loadOffe->id</p>";
echo "$id->id";
echo "<p>name: <b>$name->name</b></p>";
}
}
//  echo $loadOffe->offe->off->id;
}