\documentclass[twoside,12pt]{article}
\title{Using fancyhdr for Custom Page Header and Footers in a Two-sided Document}
\usepackage{fancyhdr}
% Clear off all default fancyhdr headers and footers
\fancyhf{}
% Put the page number at the right edge of odd pages, and left edge of even pages.
\fancyhead[RO,LE]{\thepage}
% Custom text at the left edge of odd pages, and right edge of odd pages.
\fancyhead[LO,RE]{\sffamily\itshape Fun with fancyhdr}
% Repeat for \fancyfoot if needed, e.g.
% Some decorative symbol at the centre of both odd and even pages
\fancyfoot[C]{$\spadesuit$}
% Set this length to 0pt if you don't want any lines!
\renewcommand{\headrulewidth}{2pt}
% Apply the fancy header style
\pagestyle{fancy}
\usepackage{lipsum}
\begin{document}
\section{First Section}
\lipsum[1-8]
\section{Second Section}
\lipsum[9-11]
\end{document}