---
title: "PHP 读取注册表"
author: "wangduowu"
date: "2009-06-25T17:45:57Z"
tags: []
slug: "php"
draft: false
lastmod: "2009-06-25T17:46:26Z"
id: 415140
url: "https://wangduowu.iteye.com/blog/415140"
---

```
Example on how to read a registry value:

<?php
  $shell = &new COM ( 'WScript.Shell' );
  var_dump ( $shell -> regRead ( 'HKEY_CURRENT_USER\Environment\TEMP' ));
?>

(outputs string(39) "%USERPROFILE%\Lokale Einstellungen\Temp" on my system)
```