{"id":687,"date":"2019-04-02T02:05:52","date_gmt":"2019-04-02T01:05:52","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=687"},"modified":"2019-03-12T11:10:37","modified_gmt":"2019-03-12T11:10:37","slug":"php-determine-masked-string","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/php\/php-determine-masked-string\/","title":{"rendered":"PHP determine masked string"},"content":{"rendered":"<p>Here is a preg_match expression for finding if a string contains a certain set of repeated characters, say like the masking characters in a stored credit number or say a hidden phone number<\/p>\n<pre class='wp-code-highlight prettyprint'>if(preg_match(\"\/x{5,12}\/\",\"<span style=\"color: #0000ff;\">THE STRING<\/span>\"))\u00a0 \/\/ if there are 12 consecutive <span style=\"color: #008000;\">x <span style=\"color: #808080;\">in the string, starting from position 6<\/span><\/span><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a preg_match expression for finding if a string contains a certain set of repeated characters, say like the masking characters in a stored credit number or say a hidden phone number if(preg_match(&#8220;\/x{5,12}\/&#8221;,&#8221;THE STRING&#8221;))\u00a0 \/\/ if there are 12 consecutive x in the string, starting from position 6 &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[178,177,176],"class_list":["post-687","post","type-post","status-publish","format-standard","hentry","category-php","tag-masked-string","tag-masking","tag-preg_match","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=687"}],"version-history":[{"count":1,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/687\/revisions"}],"predecessor-version":[{"id":688,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/687\/revisions\/688"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}