V
V
Vasya2020-04-14 00:01:07
PHP
Vasya, 2020-04-14 00:01:07

How to define a variable?

Hello,
In the database there is a text template in which there are variables, how to substitute a value instead of variables?Ваш номер: $tel

<?php
$tel = "790000000";
$a = bd($sql)['text'];
echo $a;
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valentyn, 2020-04-14
@rotarepmipoleved

https://www.php.net/manual/en/function.sprintf.php

$tel = "790000000";
echo sprintf("Номер телефона: %s", $tel);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question