-2
I have a playful web page, on which there are 2 Ivs, and on a PHP page, I would like to add a word to them, the array rand
I already know how to do, the problem is time to take the HTML Divs and send them to PHP, here’s what I have so far:
<html>
<div id="1">bla bla bla</div>
<div id="2">bla bla bla bla bla</div>
</html>
and now, the PHP part:
<?php
$var1="div 1 iria aqui";
$var2="div 2 iria aqui";
$random = array('$var1','$var2');
echo $random[array_rand($random)];
Welcome to Sopt, do the [tour] and read the [Ask]
– Pedro Sanção
Your question is very vague, which makes it incomprehensible. It is better to edit it by providing more information. I suggest to specify better what type of treatment and model you want.
– Ivan Ferrer
You want to
<div id="1">bla bla bla</div>
in the variable orbla bla bla
?– Jorge B.
Use javascript to take the content of div and send it by ajax to php.
– rray
@Jorgeb. I want to take the whole div.
– Jorge Felix
@rray you could post an example here?
– Jorge Felix