vscode中文插件以及运行php代码

vscode中文版插件

在这里插入图片描述

vscode运行php代码

1.插件安装

在这里插入图片描述

2.配置项

左上角文件——首选项——设置——输入php.validate.executablePath

在这里插入图片描述

在这里插入图片描述

{
   
    "workbench.colorTheme": "Default Dark Modern",
        "php.validate.executablePath": "E:/phpstudy/php.exe",
        "php.debug.executablePath": "E:/phpstudy/php.exe",
        "phpserver.phpConfigPath": "E:/phpstudy/php.ini",
        "phpserver.phpPath": "E:/phpstudy/php.exe"
}
3.尝试运行

在这里插入图片描述
代码:

<?php
$data = '{
    "hbt": "0",
    "hbt2": "2",
    "hbt3": "3"
}';

// 将JSON字符串转换为关联数组
$array = json_decode($data, true);

// 遍历数组并筛选出值不为0的对象
$result = array();
foreach ($array as $key => $value) {
   
    if ($value != "0") {
   
        $result[$key] = $value;
    }
}

// 输出结果
foreach ($result as $key => $value) {
   
    echo $key . ": " . $value . "\n";
}

在这里插入图片描述这样代表运行成功

相关推荐

  1. 【maya开发】vscode debug python 代码

    2024-01-13 02:28:01       26 阅读
  2. vscode 安装

    2024-01-13 02:28:01       61 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-13 02:28:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-13 02:28:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-13 02:28:01       82 阅读
  4. Python语言-面向对象

    2024-01-13 02:28:01       91 阅读

热门阅读

  1. Linux中创建文件的基本方法

    2024-01-13 02:28:01       53 阅读
  2. gitlab部署

    2024-01-13 02:28:01       45 阅读
  3. 1. Presto基础

    2024-01-13 02:28:01       47 阅读
  4. 安全基础知识

    2024-01-13 02:28:01       59 阅读
  5. ubuntu设定时间与外部ntp同步

    2024-01-13 02:28:01       55 阅读
  6. 69、python - 利用向量内积来优化卷积运算

    2024-01-13 02:28:01       49 阅读
  7. 如何解决TCP拥塞问题?

    2024-01-13 02:28:01       61 阅读
  8. LeetCode878. Nth Magical Number

    2024-01-13 02:28:01       53 阅读