【发布时间】:2016-04-02 14:53:45
【问题描述】:
首先感谢大家对我的帮助,请原谅我的英语,我正在努力做到最好:)
这就是我想做的:
我在 MySQL 数据库中有一个名为 acciones 的表,我希望在该表中注册的每个“操作”都在屏幕上打印的文本中进行替换:
<?php
include('../procesos/abre_conexion.php');
$query99 = "SELECT * from acciones";
// This line make the query
$result99 = mysql_query($query99);
$registro99 = mysql_fetch_array($result99)
?>
<?php
// create the function
function howls($valor) {
// set the variable // saving as array // possible texts
$variables = array('$registro99[original]',);
// $imagenes, tambien contendra un array
// with the replace text
$sus = array('$registro99[reemplazo]',);
// making the replace
return (str_replace($variables, $sus, $valor));
}
// starting function
ob_start("howls");
?>
#SalirA beber Cerveza Montoro en barrio santo con Andreita.
<?php
// ending function
ob_end_flush();
?>
<? include('../procesos/cierra_conexion.php'); ?>
但它不起作用,有什么建议吗?
【问题讨论】:
标签: php sql str-replace