-1

I try to get a news text slider and i try to do it with marquee html code, but its seams i do some thing wrong, i have try a few times to get it work and faild. This is the current code

$html= '<marquee behavior="slide" direction="left">'.echo $row['title'].'</marquee>';
ADyson
  • 57,178
  • 14
  • 51
  • 63
  • Remove the `echo` statement in the string concatenation: `$html = ''.$row['title'].'';` – BenM Oct 28 '22 at 07:28
  • 2
    wow - I thought the `marquee` tag went out with the ark – Professor Abronsius Oct 28 '22 at 07:31
  • @ProfessorAbronsius me too! [It is deprecated](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/marquee) though, so it might disappear sooner rather than later. – ADyson Oct 28 '22 at 07:51
  • "its seams i do some thing wrong" - you should at least explain what that means – Nico Haase Oct 28 '22 at 07:51
  • You can't `echo` within another `echo`. Learn about basic [string concatenation](https://stackoverflow.com/questions/8336858/how-can-i-combine-two-strings-together-in-php) – ADyson Oct 28 '22 at 07:52
  • [This might be interesting](https://stackoverflow.com/questions/31951282/why-is-marquee-deprecated-and-what-is-the-best-alternative) as an alternative – Professor Abronsius Oct 28 '22 at 07:57
  • In fact @BenM was correct that solved my problem of my question , but i also tank you to let me know a beather alternative with jquery. Also on my main was a litle error beacuse it was not in side the loop so only do once , because i was use slide and not scroll – helder ventura Oct 28 '22 at 22:16

1 Answers1

-1

HTML marquee tag, already deprecated. You may use instead it Text-Scrolling-Plugin jQuery plugin

For more information Enter here

Additionally, enter your $text in other side and check it. Perhaps exits any error..

echo $text;
Tural Rzaxanov
  • 783
  • 1
  • 7
  • 16