PHP “echo” adds white space and line break automatically. How to delete it? [on hold]Postfix character encoding?Simple cronjob issue (I think!)Uploading/Downloading PHP script issue with the Current Dedicated ServerSSH not seeming to run in bash script called via web serverApache executes HTML, but not PHP; PHP CLI worksApache reports a 200 status for non-existent WordPress URLsOverriding memory_limit with .htaccess resulting in mysterious alerts in syslog (suhosin)Apache Error 500 without log info when trying to access to a php5.3 websitephp script from sh from crontab die with no tracesWhat is causing our PHP script to stall?

What's the point of deactivating Num Lock on login screens?

Is "remove commented out code" correct English?

Why do I get two different answers for this counting problem?

Alternative to sending password over mail?

What's the difference between 'rename' and 'mv'?

In a Spin are Both Wings Stalled?

Why is the ratio of two extensive quantities always intensive?

Twin primes whose sum is a cube

prove that the matrix A is diagonalizable

What does it mean to describe someone as a butt steak?

Is there a hemisphere-neutral way of specifying a season?

How to model explosives?

Has there ever been an airliner design involving reducing generator load by installing solar panels?

What killed these X2 caps?

Combinations of multiple lists

How to draw the figure with four pentagons?

Diode datasheet reading

Should I tell management that I intend to leave due to bad software development practices?

Why can't we play rap on piano?

SSH "lag" in LAN on some machines, mixed distros

Doing something right before you need it - expression for this?

Can one be a co-translator of a book, if he does not know the language that the book is translated into?

Can I make "comment-region" comment empty lines?

90's TV series where a boy goes to another dimension through portal near power lines



PHP “echo” adds white space and line break automatically. How to delete it? [on hold]


Postfix character encoding?Simple cronjob issue (I think!)Uploading/Downloading PHP script issue with the Current Dedicated ServerSSH not seeming to run in bash script called via web serverApache executes HTML, but not PHP; PHP CLI worksApache reports a 200 status for non-existent WordPress URLsOverriding memory_limit with .htaccess resulting in mysterious alerts in syslog (suhosin)Apache Error 500 without log info when trying to access to a php5.3 websitephp script from sh from crontab die with no tracesWhat is causing our PHP script to stall?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I wanted to create a own IP Lookup page for my bash script. So I made a subdomain ip.DOMAIN.TLD and created a index.php with following content:



<?php

echo $_SERVER['REMOTE_ADDR'];

?>


The problem is that this echo statement adds a white space character at the end of the line which will be recognised by my script (it's also shown in my browser). I've seen other pages like https://myexternalip.com/raw where this white space character does not exist. It doesn't matter what I am echo'ing, it always creates that white space char at the end. So it's not a problem of the REMOTE_ADDR variable.



When I view the source code of the response I get following text (with the space and line break):



this.is.my.ip 



Why does this happen and how do I fix that?



PHP Version: 7.3.3










share|improve this question













put on hold as off-topic by HBruijn, Ward yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Ward
If this question can be reworded to fit the rules in the help center, please edit the question.











  • 2





    OT here at serverfault but you probably have extra characters outside of the actual PHP tags <?php ... ?> that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php

    – HBruijn
    2 days ago












  • @HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!

    – r00tusr
    2 days ago











  • "If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "

    – HBruijn
    2 days ago

















0















I wanted to create a own IP Lookup page for my bash script. So I made a subdomain ip.DOMAIN.TLD and created a index.php with following content:



<?php

echo $_SERVER['REMOTE_ADDR'];

?>


The problem is that this echo statement adds a white space character at the end of the line which will be recognised by my script (it's also shown in my browser). I've seen other pages like https://myexternalip.com/raw where this white space character does not exist. It doesn't matter what I am echo'ing, it always creates that white space char at the end. So it's not a problem of the REMOTE_ADDR variable.



When I view the source code of the response I get following text (with the space and line break):



this.is.my.ip 



Why does this happen and how do I fix that?



PHP Version: 7.3.3










share|improve this question













put on hold as off-topic by HBruijn, Ward yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Ward
If this question can be reworded to fit the rules in the help center, please edit the question.











  • 2





    OT here at serverfault but you probably have extra characters outside of the actual PHP tags <?php ... ?> that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php

    – HBruijn
    2 days ago












  • @HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!

    – r00tusr
    2 days ago











  • "If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "

    – HBruijn
    2 days ago













0












0








0








I wanted to create a own IP Lookup page for my bash script. So I made a subdomain ip.DOMAIN.TLD and created a index.php with following content:



<?php

echo $_SERVER['REMOTE_ADDR'];

?>


The problem is that this echo statement adds a white space character at the end of the line which will be recognised by my script (it's also shown in my browser). I've seen other pages like https://myexternalip.com/raw where this white space character does not exist. It doesn't matter what I am echo'ing, it always creates that white space char at the end. So it's not a problem of the REMOTE_ADDR variable.



When I view the source code of the response I get following text (with the space and line break):



this.is.my.ip 



Why does this happen and how do I fix that?



PHP Version: 7.3.3










share|improve this question














I wanted to create a own IP Lookup page for my bash script. So I made a subdomain ip.DOMAIN.TLD and created a index.php with following content:



<?php

echo $_SERVER['REMOTE_ADDR'];

?>


The problem is that this echo statement adds a white space character at the end of the line which will be recognised by my script (it's also shown in my browser). I've seen other pages like https://myexternalip.com/raw where this white space character does not exist. It doesn't matter what I am echo'ing, it always creates that white space char at the end. So it's not a problem of the REMOTE_ADDR variable.



When I view the source code of the response I get following text (with the space and line break):



this.is.my.ip 



Why does this happen and how do I fix that?



PHP Version: 7.3.3







php web-server ip






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 days ago









r00tusrr00tusr

713




713




put on hold as off-topic by HBruijn, Ward yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Ward
If this question can be reworded to fit the rules in the help center, please edit the question.







put on hold as off-topic by HBruijn, Ward yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Ward
If this question can be reworded to fit the rules in the help center, please edit the question.







  • 2





    OT here at serverfault but you probably have extra characters outside of the actual PHP tags <?php ... ?> that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php

    – HBruijn
    2 days ago












  • @HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!

    – r00tusr
    2 days ago











  • "If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "

    – HBruijn
    2 days ago












  • 2





    OT here at serverfault but you probably have extra characters outside of the actual PHP tags <?php ... ?> that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php

    – HBruijn
    2 days ago












  • @HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!

    – r00tusr
    2 days ago











  • "If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "

    – HBruijn
    2 days ago







2




2





OT here at serverfault but you probably have extra characters outside of the actual PHP tags <?php ... ?> that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php

– HBruijn
2 days ago






OT here at serverfault but you probably have extra characters outside of the actual PHP tags <?php ... ?> that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php

– HBruijn
2 days ago














@HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!

– r00tusr
2 days ago





@HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!

– r00tusr
2 days ago













"If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "

– HBruijn
2 days ago





"If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "

– HBruijn
2 days ago










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

Why did Thanos need his ship to help him in the battle scene?Which actor plays Thanos in the Avengers mid-credits scene?Are there economic implications portrayed in comics where the buildings and cities are ruined almost daily?Old X-Men comic where team travels to alien world with a ring-like sun that needs recharging?Why does Ego need help sleeping?Is there an objective answer to who “the strongest Avenger” is?How did Banner get unstuck?Why did Thanos get hit?How did Thanos (or anyone) know the Infinity Stones would give him this power?Did Thanos leave Eitri alive for his after-sales service?In Avengers 1, why does Thanos need Loki?