$var="This is a book.
I am a boy.
What is your name?
Good morning!
hello, Tom!";
$var='
'. $var;
$var=str_replace(chr(10), chr(10).'(^)', $var);
$token=strtok($var, '^');
$counter=0;
$numbering='';
while ($token != false):
$numbering .=$counter++. $token;
$token=strtok('^');
endwhile;
$numbering=str_replace('0', '', $numbering);
echo $numbering;
The code above produces the result below.
I like to make my target result below.
The code below is one of my trials for my target result above.
Hi @joon1, could you please share what the point of this is? Are you just trying to learn something or is there some problem this is supposed to solve?
The result above is the simplified form of my target result below.
<a href="#1">1</a><div id="1"></div>This is a book.
<a href="#2">2</a><div id="1"></div>I am a boy.
<a href="#3">3</a><div id="1"></div>What is your name?
<a href="#4">4</a><div id="1"></div>Good morning!
<a href="#5">5</a><div id="1"></div>hello, Tom!
Tthe numbers are added by 3 times per line like the following is the problem what I want solve.
<a href="#1">2</a><div id="3"></div>This is a book.
<a href="#4">5</a><div id="6"></div>I am a boy.
<a href="#7">8</a><div id="9"></div>What is your name?
<a href="#10">11</a><div id="12"></div>Good morning!
<a href="#13">14</a><div id="15"></div>hello, Tom!
I am sorry my target result which is posted in #4 has some typo errors.
The following is my target restul.
<a href="#1">1</a><div id="1"></div>This is a book.
<a href="#2">2</a><div id="2"></div>I am a boy.
<a href="#3">3</a><div id="3"></div>What is your name?
<a href="#4">4</a><div id="4"></div>Good morning!
<a href="#5">5</a><div id="5"></div>hello, Tom!
I modified my target result for removing the empty div like the following.
<a href="#1" id="1">1</a>This is a book.
<a href="#2" id="2">2</a>I am a boy.
<a href="#3" id="3">3</a>What is your name?
<a href="#4" id="4">4</a>Good morning!
<a href="#5" id="5">5</a>hello, Tom!
Hi @joon1,
Quite some time ago you mentioned how you managed to connect your computer to the internet and to use your own domain. At the time I was busy and did not manage to get it to work. I would be grateful if you could raise another topic and describe in detail the steps to achieve creating the following: