douchi1945 2013-10-29 21:35
浏览 69

我似乎无法检索存储在数据库中的正则表达式 - php

So I am having a bit of an issue getting results from a query.

<?php
$query = "SELECT re_diag_DL
          FROM game_win_regex 
          WHERE game_id = 1
          LIMIT 1";
$con = mysqli_connect("localhost",'root','','game');
$result = mysqli_query($con,$query);
$row = mysqli_fetch_all($result,MYSQLI_BOTH);
echo $row['re_diag_DL'][0];
?>

The fields content is a regular expression:

((?<!z,)[1]

But the echo is giving

((?

It is definitely messing with the array structure, a print_r() gives

Array ( [0] => Array ( [0] => ((?

I intend to use this result within a preg_match_all. Any help on this matter would be greatly appreciated.

  • 写回答

3条回答 默认 最新

  • douxiong2738 2013-10-29 21:38
    关注

    Most likely the echoing is being done in a web browser and the browser is expecting a tag starting with <.

    Check the source code of the page, not the rendered page.

    By the way, you can safely use the result of $row['re_diag_DL'][0] in a preg_match_all as it is merely a display issue.

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向