我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

**文本中的粗体文字**标记php [复制]

This question already has an answer here:

  • Make text between asterisks bold 2 answers
  • BBcode regex for **bold text** 4 answers

I'm working in this function that colors an username in case it exists @username within an string.

PHP

$string="this **text** contains a second **content**"

I want to bold the text contained within text

I tried but nothing

 function bold_word($string) {
   return preg_replace('/(\**+)/', "<b>$1</b>", $string);
    }
</div>

近期文章

  • PDF格式的字符串中的奇怪符号但不包含在字符串中?
  • 从字符串php wordpress获取ID
  • php mysqli与phpmyadmin相比返回不同的行数
  • Internet Explorer 11 / Microsoft Edge中的碳错误
  • MySQL查询后的转换问题
  • lumen - handler.php不反映更新
  • 迁移WordPress Multisite
  • 如何在Notepad ++中为输出JS的PHP文件设置语法高亮?
  • 基本网站的结构
  • 提高mysql xampp服务器的速度
  • Laravel联系表格空附件档案
  • Braintree更新从每年到每月PHP的订阅
  • HTTP_X_FORWARDED_FOR显示ipv6和ipv4
  • PHP如何通过CIDR函数运行IP范围列表?
  • 表单提交后保持相同的Bootstrap选项卡
  • PHP html_decode / html_entity_decode打破了JS的页面
  • 使用modulo获取范围内的随机整数
  • XHR请求失败 - 网络选项卡中的待处理/取消,站点运行缓慢
  • Google-api-php-client错误:未找到Codegniter类'Basecontroller'?
  • 使用mysqli验证插入重复条目是不起作用的

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华